Guest User

Untitled

a guest
Oct 15th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <html>
  2. <!-- greportBot Interface: By techkid6 -->
  3. <head>
  4. <title>greportBot Web Interface</title>
  5. </head>
  6. <body>
  7. <center><p>greportBot Web Interface</p></center>
  8. <!-- Main PHP Code -->
  9. <?php
  10. //Variables
  11. $server="";
  12. $username="";
  13. $password="";
  14. $database="";
  15. $con = mysql_connect($server,$username,$password);  //Connect to server
  16. if (!$con)
  17.   {
  18.   die('Could not connect: ' . mysql_error());  //Connection Failed: Show Error
  19.   }
  20. @mysql_select_db($database) or die( "Unable to select database");  //Connects to database
  21. $query="SELECT * FROM greport";  //Grabs All Greports From Database
  22. $result=mysql_query($query);  //Querys the Database
  23. $num=mysql_query("SELECT COUNT(*) FROM greport");  //Finds number of entries
  24. $i=0;  // Loop
  25. while ($i < $num) {
  26. echo "<table border='1'>
  27. <tr>
  28. <th>Username</th>
  29. <th>Block</th>
  30. <th>X</th>
  31. <th>Y</th>
  32. <th>Z</th>
  33. <th>Comment</th>
  34. <th>Checked</th>
  35. </tr>";
  36. while($row = mysql_fetch_array($result))
  37.   {
  38.   echo "<tr>";
  39.   echo "<td>" . $row['user'] . "</td>";
  40.   echo "<td>" . $row['block'] . "</td>";
  41.   echo "<td>" . $row['x'] . "</td>";
  42.   echo "<td>" . $row['y'] . "</td>";
  43.   echo "<td>" . $row['z'] . "</td>";
  44.   echo "<td>" . $row['comment'] . "</td>";
  45.   echo "<td><a href=/check.php?id=" . $row['id'] . ">Check Off </a></td>";
  46.   echo "</tr>";
  47.   }
  48. echo "</table>";
  49. $i++;
  50. }
  51.  
  52. ?>
  53. </body>
  54. </html>
Add Comment
Please, Sign In to add comment