Advertisement
Guest User

list.php

a guest
Jun 4th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Link Directory</title>
  6. <style type="text/css">
  7. <!--
  8. body {
  9.     background-image: url(http://example.com/img/bg.jpg);
  10.     background-repeat: repeat;
  11. }
  12. -->
  13. </style>
  14. </head>
  15.  
  16. <body><center>
  17. <?php
  18. $con=mysqli_connect("localhost","root","","dir");
  19. // Check connection
  20. if (mysqli_connect_errno())
  21.   {
  22.   echo "Failed to connect to MySQL: " . mysqli_connect_error();
  23.   }
  24.  
  25. $result = mysqli_query($con,"SELECT * FROM link");
  26.  
  27. echo '<table width="684" border="1" align="center" bgcolor="#FFFFFF">
  28. <tr>
  29. <th width="103">ID</th>
  30. <th width="311">Page Title</th>
  31. <th width="248">Click For Details/Longer Description</th>
  32. </tr>';
  33.  
  34. while($row = mysqli_fetch_array($result))
  35.   {
  36.   echo "<tr>";
  37.   echo "<td height="23">" . $row['id'] . "</td>";
  38.   echo "<td>" . $row['title'] . "</td>";
  39.   echo "<td><a href=\"link.php?id=" . $row['id'] . "\">Click Here</a></td>";
  40.   echo "</tr>";
  41.   }
  42. echo "</table>";
  43.  
  44. mysqli_close($con);
  45. ?></center>
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement