Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 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. Username: <input type="text" name="username" value="" /><br />
  8. <br />
  9. Password: <input type="password" name="password" value="" /><br />
  10. <br />
  11. Name: <input type="text" name="name" value="" /><br />
  12. <br />
  13. Address: <input type="text" name="address" value="" /><br />
  14. <br />
  15. Country: <input type="text" name="country" value="" /><br />
  16. <br />
  17. Zip Code: <input type="text" name="zip" value="" /><br />
  18. <br />
  19. Phone Number: <input type="text" name="phone" value="" /><br />
  20. <br />
  21.  
  22.  
  23. Email: <input type="text" name="email" value="" />
  24. <br />
  25. <input type="submit" />
  26. </form>
  27.  
  28.  
  29.  
  30.  
  31. </body>
  32. </html>
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. <html>
  43. <head>
  44. <title>Shit</title>
  45. </head>
  46. <body>
  47.  
  48. <?php
  49. //defining username, password, and database variables so I can easily change them later.
  50.  
  51. $username="root";
  52. $password="tacotruck";
  53. $database="form";
  54.  
  55. $username=$_POST['username'];
  56. $password=$_POST['password'];
  57. $name=$_POST['name'];
  58. $address=$_POST['address'];
  59. $country=$_POST['country'];
  60. $zip=$_POST['zip'];
  61. $phone=$_POST['phone'];
  62. $email=$_POST['email'];
  63.  
  64. mysql_connect("localhost", $username, $password) or die("Unable to connect to MySQL.");
  65.  
  66. $query = "INSERT INTO test_table (username, password, name, address, country, zip, phone, email)
  67. VALUES ('$username','$password','$name','$address','$country','$zip','$phone','$email')";
  68. mysql_query($query);
  69. echo mysql_error();
  70.  
  71.  
  72. echo $username";
  73. echo $password";
  74.  
  75.  
  76. mysql_close();
  77. ?>
  78.  
  79.  
  80. </body>
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement