Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL ^ E_NOTICE);
- session_start();
- $userid = $_SESSION['id'];
- $username = $_SESSION['username'];
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>McNally robotics build log</title>
- </head>
- <body>
- <p>
- <?php
- if($userid && $username){
- echo "Welcome <strong>$username!</strong>";
- $form = "
- <table>
- <tr>
- <td><a href='./member.php'>Members page</a></td>
- <td><a href='./member.php'>Add a post</a></td>
- </tr>
- </table>";
- echo $form;
- }else{
- echo '<p><a href="./login.php">Login</a>';
- }
- ?>
- <br>
- This is the McNally High Robotics build and design online log.</p>
- <?php
- require("./PHPScripts/logconnector.php");
- $id = 1;
- $query = mysql_query("SELECT * FROM log WHERE isValid='$id' ");
- echo '<table border="1" align="center">';
- while($row = mysql_fetch_array($query)){
- $post = $row['post'];
- $date = $row['date'];
- $user = $row['user'];
- echo "<br>";
- echo "<tr>";
- echo "$date";
- echo "<br>";
- echo "<tr>";
- echo "$post";
- echo "<br>";
- echo "<tr>";
- echo "$user";
- echo "<br>";
- echo "</tr>";
- }
- echo "</table>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment