Dear all,
Below here I show you a redirected page from a login.php where shows the results os the login session.
This page will be once again redirected to an edit_user.php page.
The question is how do I retrieve this loggedin user_id from the database.
I have already tried GET_uid and many other forms of request without success.
I would be GREATFUL if any one could help me by that ! THANKS A LOT!
THANK YOU VERY MUCH ! Naira
Below here I show you a redirected page from a login.php where shows the results os the login session.
This page will be once again redirected to an edit_user.php page.
The question is how do I retrieve this loggedin user_id from the database.
I have already tried GET_uid and many other forms of request without success.
I would be GREATFUL if any one could help me by that ! THANKS A LOT!
Code:
if (isset($_SESSION['first_name']) && ($_SESSION['last_name' ]) && ($_SESSION['email']) && ($_SESSION['user_id']) && ($_SESSION['registration_date']) ) {
?><td><?php
echo "<br /><br /><fieldset><p>Welcome, {$_SESSION['first_name']} {$_SESSION['last_name']}!</p>
<p>E-mail address: {$_SESSION['email']}</p>
<p>Registration date: {$_SESSION['registration_date']}</p>
<p>Your ad...(s)</p>
<p>User_id: {$_SESSION['user_id']}</p>";
echo "</fieldset >";
}
if (isset($_GET['uid'])) {
$uid = (int) $_GET['uid'];
if ($uid > 0) {
$query = "SELECT user_id AS $uid FROM users WHERE user_id = $_SESSION[user_id]" ;
$result = @mysql_query ($query);
echo '<table>
<tr>
<td align="left"><a href="edit_user.php?view= ' . $SESSION['user_id'] . '">Edit</a></td>
<td align="left"><a href="delete_user.php?view= ' . $SESSION['user_id'] . '">Delete</a></td>
</tr>
'
; '</table>' ;
}
mysql_close();
}
THANK YOU VERY MUCH ! Naira
Comment