Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>AirZooka ftw</title>
  4. </head>
  5. <body>
  6. <form action="test.php" method="post">
  7.  
  8. Name: <input type="text" name="name" value="" /><br />
  9. <br />
  10. Address: <input type="text" name="address" value="" /><br />
  11. <br />
  12. Country: <input type="text" name="country" value="" /><br />
  13. <br />
  14. Zip Code: <input type="text" name="zip" value="" /><br />
  15. <br />
  16. Phone Number: <input type="text" name="phone" value="" /><br />
  17. <br />
  18.  
  19.  
  20. Email: <input type="text" name="email" value="" />
  21. <br />
  22. <input type="submit" />
  23. </form>
  24.  
  25.  
  26.  
  27.  
  28. </body>
  29. </html>
  30.  
  31.  
  32.  
  33. <html>
  34. <head>
  35. <title>AirZooka ftw</title>
  36. </head>
  37. <body>
  38. <?php
  39. //defining username, password, and database variables so I can easily change them later.
  40.  
  41. $username="root";
  42. $password="tacotruck";
  43. $database="form";
  44.  
  45.  
  46. $name=$_POST['name'];
  47. $address=$_POST['address'];
  48. $country=$_POST['country'];
  49. $zip=$_POST['zip'];
  50. $phone=$_POST['phone'];
  51. $email=$_POST['email'];
  52.  
  53. mysql_connect(localhost,$username,$password);
  54. @mysql_select_db($database) or die( "Unable to select database");
  55.  
  56. $query = "INSERT INTO test_table VALUES ('$name','$address','$country','$zip','$phone','$email')";
  57. mysql_query($query);
  58.  
  59. mysql_close();
  60.  
  61.  
  62.  
  63.  
  64. echo $email;
  65.  
  66. ?>
  67. </body>
  68. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement