0

I now how to make a profile but how to make for every user when he logs to view button my profile and takes them to their profile.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by CFROG
0

You would set up your button to point to something like "MyProfile.php" and when the user is logged in and lands on that page the information that is presented to them can be specific to just that user with a simple query to the database using session variables to retrieve the info for that user. For example:

$sql=mysql_query("SELECT * FROM users WHERE id='$_SESSION[user_id]'");
while($row=mysql_fetch_assoc($sql) {
$user=$row['user_name']; }

echo ' Welcome '.$user.' ';

Of course you can have it look up whatever info you want.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.