Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. $dbhost = "";
  4. $dbname = "ZIP";
  5. $dbusername = "";
  6. $dbpassword = "";
  7.  
  8. $link = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbusername,$dbpassword);
  9.  
  10.  
  11. $zip = htmlspecialchars($_POST['zip']);
  12. $email = htmlspecialchars($_POST['email']);
  13.  
  14. $statement = $link->prepare("INSERT INTO ZIP(ZIP,EMAIL)
  15. VALUES(:zip, :email)");
  16.  
  17. $statement->bindParam(':zip', $zip);
  18. $statement->bindParam(':email', $email);
  19. $statement->execute();
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement