TGWSE_GY Posted April 21, 2009 Share Posted April 21, 2009 Okay we have the base of our site down, we can store the users profile information and recall it on the "update profile" page. Now my question is what is the best way to retrieve a users profile to display to another user? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/155093-solved-displaying-profiles/ Share on other sites More sharing options...
The Little Guy Posted April 21, 2009 Share Posted April 21, 2009 Something like so: http://mysite.com/profile.php?uid=38 if(isset($_GET['uid'])){ $uid = mysql_real_escape_string($_GET['uid']); }elseif(isset($_SESSION['id'])){ $uid = mysql_real_escape_string($_SESSION['id']); }else{ header("Location: /"); exit; } $sql = mysql_query("SELECT * FROM users WHERE id = '$uid'"); $row = mysql_fetch_array($sql); Quote Link to comment https://forums.phpfreaks.com/topic/155093-solved-displaying-profiles/#findComment-815804 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.