All pastes #902576 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-13 16:53 UTC
rendered paste body
<?php
session_start();
include "config.php";
include "opendb.php";
// is the one accessing this page logged in or not?
if (!isset($_SESSION['db_is_logged_in'])
   || $_SESSION['db_is_logged_in'] !== true) {
 
   // not logged in, move to login page
   header('Location: login.php');
   exit;
}
 
$userId = $_SESSION['Name'];
$result = mysql_query("SELECT * FROM members WHERE Name='" . mysql_escape_string($userId) . "'");
$row = mysql_fetch_assoc ($result);
 
echo '<body bgcolor="black"> ';
echo '<div id="nav" align="right"> ';
echo '<b><a href="main.php">Main</a></b> |';
if($_SESSION['adminlevel'] > 10) echo ' <a href="admin.php">Admin</a> |';
if($_SESSION['Leader'] == 16) echo ' <a href="gangcp.php">GangCP</a> |';
echo ' <a href="updatepass.php">Change Password</a> ';
echo ' <a href="logout.php">Logout</a> |';
echo '</div>';
 
echo '<div id="UserStats"><h3><font color="white">Welcome ' . $userId . '</h3><h2>Your Stats:</h2></font>';
echo '<table><tr><td><font color="white">Stat </font></td><td><font color="white">Value </font></td><td>   </td><td><font color="white">Name </td><td>Value </td></tr></font>';
$keys = array_keys($row);
$count = 0;
foreach($keys as &$key) {
        if($count%2) echo '<tr>';
        echo '<td bgcolor="darkred"><font color="white">' . $key . '</font></td><td bgcolor="grey"><font color="white"><center>' . $row[$key] . '</center></font></td><td><pre>   </pre></td>';
        $count++;
        if($count%2) echo '</tr>';
}
 
echo '</table></div>';
 
?>