hot to list the details of user?
Posted: Thu May 13, 2004 6:27 am
this is the page after login
this is the link from previous page
Code: Select all
<?php
<?php
session_start();
echo '<h1>Members only</h1>';
if (isset($HTTP_SESSION_VARS['valid_user']))
{
echo '<p>You are logged in as '.$HTTP_SESSION_VARS['valid_user'].'</p>';
?>
<html>
<HEAD><TITLE>Member Section</TITLE>
</HEAD>
<body>
<div align="right"></div>
<table width="701" border="0" align="left">
<tr>
<a href="userview.php?userID = '{$_REQUEST['userID']}'">View Profile </a>
<td width="285"><div align="center"></div></td>
</tr>
</table>
<p align="left"><br>
</p>
<div align="left"><br>
</div>
<p> </p>
</body>
</html>
<?
exit;
}
else
{
echo '<p>You are not logged in..</p>';
echo '<p>Only logged in members may see this page.</p>';
}
echo '<a href="index.php">Back to main page</a>';
?>
?>this is the link from previous page
Code: Select all
<?php
<html>
<head>
<title>List MY Records</title>
</head>
<h1>My Profile</h1></center>
<?php
$db = @mysql_pconnect('localhost','root');
if (!$db)
{
echo 'Error: no record to database. Please try again later.';
exit;
}
mysql_select_db('mobile');
$query = "select * from user where userID='{$_REQUEST['userID']}' ";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
{
echo htmlspecialchars(stripslashes($row['userID']));
echo '</strong><br />Name: ';
echo stripslashes($row['username']);
echo '<br />ID: ';
echo stripslashes($row['userID']);
echo '<br />Email: ';
echo stripslashes($row['Email']);
echo '<br />password: ';
echo stripslashes($row['password']);
echo '</p>';
}
mysql_close();
?>
</body>
</html>
?>