Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. include('header.php');
  2.  
  3. $name = $_POST['name'];
  4. $score = $_POST['score'];
  5. $dept = $_POST['dept'];
  6.  
  7. $MyDB->prep("INSERT INTO demo (`id`,`name`,`score`,`dept`, `date`) VALUES ('','$name','$score','$dept','$date')");
  8. // Bind a value to our :id hook
  9. // Produces: SELECT * FROM demo_table WHERE id = '23'
  10. $MyDB->bind(':date', $date);
  11. // Run the query
  12. $MyDB->run();
  13.  
  14. header('Location:index.php');
  15. exit;
  16.  
  17. Warning: Cannot modify header information - headers already sent by (output
  18. started at /Applications/MAMP/htdocs/testygubbins/OO/test/header.php:15) in
  19. /Applications/MAMP/htdocs/testygubbins/OO/test/form.php on line 16.
  20.  
  21. <?php
  22. include('class.user.php');
  23. include('class.Connection.php');
  24.  
  25. $date = date('Y-m-j');
  26.  
  27. ?>
  28. <html>
  29. <head>
  30. <link rel=StyleSheet href="css/style.css" type="text/css" media=screen>
  31. <title>Test</title>
  32. </head>
  33. <body>
  34. <div id="page">
  35.  
  36. include('class.user.php');
  37. include('class.Connection.php');
  38.  
  39. $date = date('Y-m-j');
  40.  
  41. **ob_start();**
  42.  
  43. include('header.php');
  44.  
  45. $name = $_POST['name'];
  46. $score = $_POST['score'];
  47. $dept = $_POST['dept'];
  48.  
  49. $MyDB->prep("INSERT INTO demo (`id`,`name`,`score`,`dept`, `date`) VALUES ('','$name','$score','$dept','$date')");
  50. // Bind a value to our :id hook
  51. // Produces: SELECT * FROM demo_table WHERE id = '23'
  52. $MyDB->bind(':date', $date);
  53. // Run the query
  54. $MyDB->run();
  55.  
  56. header('Location:index.php');
  57.  
  58. **ob_end_flush();**
  59.  
  60. exit;
  61.  
  62. <?php
  63. include('class.user.php');
  64. include('class.Connection.php');
  65. ?>
  66.  
  67. <script type="text/javascript">
  68. window.location.href='index.php';
  69. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement