turt2live

Untitled

Apr 29th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL ^ E_NOTICE);
  3. session_start();
  4. $userid = $_SESSION['id'];
  5. $username = $_SESSION['username'];
  6. ?>
  7.  
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  12. <title>McNally robotics build log</title>
  13. </head>
  14. <body>
  15.  
  16. <p>
  17. <?php
  18. if($userid && $username){
  19. echo "Welcome <strong>$username!</strong>";
  20. $form = "
  21. <table>
  22. <tr>
  23. <td><a href='./member.php'>Members page</a></td>
  24. <td><a href='./member.php'>Add a post</a></td>
  25. </tr>
  26. </table>";
  27. echo $form;
  28. }else{
  29. echo '<p><a href="./login.php">Login</a>';
  30. }
  31.  
  32. ?>
  33.  
  34.  
  35.  
  36. <br>
  37. This is the McNally High Robotics build and design online log.</p>
  38.  
  39.  
  40. <?php
  41.  
  42.  
  43.  
  44. require("./PHPScripts/logconnector.php");
  45. $id = 1;
  46. $query = mysql_query("SELECT * FROM log WHERE isValid='$id' ");
  47.  
  48.  
  49. echo '<table border="1" align="center">';
  50. while($row = mysql_fetch_array($query)){
  51. $post = $row['post'];
  52. $date = $row['date'];
  53. $user = $row['user'];
  54. echo "<br>";
  55. echo "<tr>";
  56. echo "$date";
  57. echo "<br>";
  58. echo "<tr>";
  59. echo "$post";
  60. echo "<br>";
  61. echo "<tr>";
  62. echo "$user";
  63. echo "<br>";
  64. echo "</tr>";
  65.  
  66. }
  67. echo "</table>";
  68.  
  69.  
  70.  
  71.  
  72. ?>
  73.  
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment