automaticly you should make a SQL query to retive the info ,
and u
parse the var from the SESSION
$query = mysql_query("SELECT * FROM usertabel WHERE
user=$user_session");
and $user_session should be the username of user and should
be stored
in session when the pass & user is correct when the
visitor try to auth
<?php
$username =trim(addslashes($userlog));
$password = md5($passlog);
$query_1 = mysql_query("SELECT * FROM hs_users WHERE
username='$username' and password='$password' and
active='1'");
$singin = mysql_num_rows($query_1);
if($singin !=0){
$_SESSION['user_session'] = $username;
header("Location: index.php");
}
if($singin==0){
warning("ERROR");
}
?>
Flickle wrote:
> Basically im setting up user based website. I need to
know the best way
> to auth a user to login and then how to retrieve all
the relevant
> information for this user once logged in can anybody
help
>
> Ive read about $_sessions and cookies but i need a step
by step guide
> pls help
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysql googlegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribe googlegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---
|