Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(!isset($_SESSION['valid']))
- header('Location: login.php');
- else{
- include_once("config.php");
- $result=mysql_query("SELECT id,name,age,email FROM users ORDER BY id DESC");
- ?>
- <html>
- <title>Homepage</title>
- <body>
- <a href='index.php'>Home</a> | <a href="add.html">Add New Data</a>
- <br/><br/>
- <table width='100%' border=0>
- <tr bgcolor='#CCCCCC'>
- <th>Name</th>
- <th>Age</th>
- <th>Email</th>
- <th>Update</th>
- </tr>
- <?php
- while($res=mysql_fetch_assoc($result)){
- echo "
- <tr>
- <td>".$res['name']."</td>
- <td>".$res['age']."</td>
- <td>".$res['email']."</td>
- <td><a href='edit.php?id={$res['id']}'>Edit</a> | <a href='delete.php?id={$res['id']}'>Delete</a></td>
- </tr>";
- }
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement