Advertisement
tmen

openHouseRecieve.php

Jan 7th, 2019
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <?php
  10. $servername = "localhost";
  11. $username = "playground18";
  12. $password = "Cdz5SOVrY2p8fnWS";
  13. $dbname = "playground18";
  14. $t = $_GET['teacher'];
  15. $s1 = $_GET['s1'];
  16. $s2 = $_GET['s2'];
  17. $s3 = $_GET['s3'];
  18. $s4 = $_GET['s4'];
  19. $s5 = $_GET['s5'];
  20. $s6 = $_GET['s6'];
  21.  
  22. try
  23. {
  24. $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  25. $sql = "UPDATE tanay_open_house SET student1 = '$s1' WHERE teacher='$t'";
  26. $conn->exec($sql);
  27. $sql = "UPDATE tanay_open_house SET student2 = '$s2' WHERE teacher='$t'";
  28. $conn->exec($sql);
  29. $sql = "UPDATE tanay_open_house SET student3 = '$s3' WHERE teacher='$t'";
  30. $conn->exec($sql);
  31. $sql = "UPDATE tanay_open_house SET student4 = '$s4' WHERE teacher='$t'";
  32. $conn->exec($sql);
  33. $sql = "UPDATE tanay_open_house SET student5 = '$s5' WHERE teacher='$t'";
  34. $conn->exec($sql);
  35. $sql = "UPDATE tanay_open_house SET student6 = '$s6' WHERE teacher='$t'";
  36. $conn->exec($sql);
  37. }
  38. catch(PDOException $e)
  39. {
  40. echo "Error: " . $e->getMessage();
  41. }
  42. $conn = null;
  43. header('Location: openHouseHome.php');
  44. ?>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement