Guest User

Untitled

a guest
Jan 10th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. $hostname = "localhost";
  4. $db_user = "swade_steven";
  5. $db_password = "yeahman";
  6. $db_table = "upstate_show";
  7.  
  8.  
  9. $db = mysql_connect($hostname, $db_user, $db_password);
  10. mysql_select_db("swade_information");
  11. ?>
  12. <html>
  13. <head>
  14.  
  15. <title>18th Annual Upstate High School Art Exhibit</title>
  16. </head>
  17. <body>
  18. <hr>
  19. <?php
  20. if (isset($_REQUEST['Submit']))
  21. {
  22. # THIS CODE TELL MYSQL TO INSERT THE DATA FROM THE FORM INTO YOUR MYSQL TABLE
  23. $sql = "INSERT INTO $db_table(name,grade,homePhone,homeAddress,homeCity,homeState,homeZip,homeCounty,title,category,height,width,depth,media,schoolName,principal,instructor,schoolAddress,schoolCity,schoolState,schoolZip,schoolCounty,schoolPhone) values ('$name','$grade','$homePhone','$homeAddress','$homeCity','$homeState','$homeZip','$homeCounty','$title','$category','$height','$width','$depth','$media','$schoolName','$principal','$instructor','$schoolAddress','$schoolCity','$schoolState','$schoolZip','$schoolCounty','$schoolPhone')";
  24. if($result = mysql_query($sql ,$db))
  25. {
  26. echo "Thank you for your entry";
  27. }
  28. else
  29. {
  30. echo "ERROR: ".mysql_error();
  31. }
  32.  
  33. }
  34. else
  35. {
  36. ?>
  37.  
  38. <?php
  39. }
  40. ?>
  41. </body>
  42. </html>
Add Comment
Please, Sign In to add comment