Advertisement
Guest User

Untitled

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