Server IP : 2a02:4780:3:1493:0:3736:a38e:7 / Your IP : 216.73.216.139 Web Server : LiteSpeed System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.40.1.lve.el8.x86_64 #1 SMP Wed Feb 12 18:54:57 UTC 2025 x86_64 User : u926327694 ( 926327694) PHP Version : 7.4.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u926327694/domains/smsoft.in/public_html/demo/src/../ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php // First we execute our common code to connection to the database and start the session require("common.php"); // At the top of the page we check to see whether the user is logged in or not if(!isset($_SESSION['user']) && !isset($_SESSION['Mng_User'])) { // If they are not, we redirect them to the login page. header("Location: login.php"); // Remember that this die statement is absolutely critical. Without it, // people can view your members-only content without logging in. die("Redirecting to login.php"); } // Everything below this point in the file is secured by the login system // We can retrieve a list of members from the database using a SELECT query. // In this case we do not have a WHERE clause because we want to select all // of the rows from the database table. $query = " SELECT id, username, email FROM users "; try { // These two statements run the query against your database table. $stmt = $db->prepare($query); $stmt->execute(); } catch(PDOException $ex) { // Note: On a production website, you should not output $ex->getMessage(). // It may provide an attacker with helpful information about your code. die("Failed to run query: " . $ex->getMessage()); } // Finally, we can retrieve all of the found rows into an array using fetchAll $rows = $stmt->fetchAll(); ?> <h1>Memberlist</h1> <table> <tr> <th>ID</th> <th>Username</th> <th>E-Mail Address</th> </tr> <?php foreach($rows as $row): ?> <tr> <td><?php echo $row['id']; ?></td> <!-- htmlentities is not needed here because $row['id'] is always an integer --> <td><?php echo htmlentities($row['username'], ENT_QUOTES, 'UTF-8'); ?></td> <td><?php echo htmlentities($row['email'], ENT_QUOTES, 'UTF-8'); ?></td> </tr> <?php endforeach; ?> </table> <a href="dashboard.php">Go Back</a><br />