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 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); Link to comment https://forums.phpfreaks.com/topic/155093-solved-displaying-profiles/#findComment-815804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.