Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Bienvenue sur le site</title>
- </head>
- <body style=”background-image:url(pattern.gif); background-repeat:repeat”>
- <br />
- <?php
- $host="localhost"; // Hostnom
- $username=""; // Mysqlutilisateur
- $password=""; // Mysqlmotdepase
- $db_name="test"; // Databasenom
- $tbl_name="forum_question"; // Tablenom
- // Connexion au serveur et a la databse.
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $sql="SELECT * FROM $tbl_name ORDER BY id DESC";
- $result=mysql_query($sql);
- ?>
- <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td width="6%" align="center" bgcolor="#E6E6E6"><strong>#</strong></td>
- <td width="53%" align="center" bgcolor="#E6E6E6"><strong>Topic</strong></td>
- <td width="15%" align="center" bgcolor="#E6E6E6"><strong>Views</strong></td>
- <td width="13%" align="center" bgcolor="#E6E6E6"><strong>Reponses</strong></td>
- <td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Heure</strong></td>
- </tr>
- <?php
- while($rows=mysql_fetch_array($result)){
- ?>
- <tr>
- <td bgcolor="#FFFFFF"><?php echo $rows['id']; ?></td>
- <td bgcolor="#FFFFFF"><a href="view_topic.php?id=<?php echo $rows['id']; ?>"><?php echo $rows['topic']; ?></a><BR></td>
- <td align="center" bgcolor="#FFFFFF"><?php echo $rows['view']; ?></td>
- <td align="center" bgcolor="#FFFFFF"><?php echo $rows['reply']; ?></td>
- <td align="center" bgcolor="#FFFFFF"><?php echo $rows['datetime']; ?></td>
- </tr>
- <?php
- }
- mysql_close();
- ?>
- <tr>
- <td colspan="5" align="right" bgcolor="#E6E6E6"><a href="create_topic.php"><strong>Creation d'un nouveau Topic</strong> </a></td>
- </tr>
- </table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment