Home › Forums › Back End › Nice Profile URL? › Re: Nice Profile URL?
February 2, 2012 at 3:10 pm
#96045
Member
ok i get what you are doing.
So if you have profile.php?id=roger
Then you need to do
if (isset($_GET) && $_GET!==$_SESSION) {
$user = mysql_real_escape_string($_GET);
$result = ‘SELECT * from users where username = ‘”‘.$user.'”‘;
if (mysql_num_rows($result)==0) {
echo (‘invalid user’);
exit;
}
}
else {
$result = ‘SELECT * from users where username = ‘”‘.$_SESSION.'”‘;
}
$profileinfo = mysql_fetch_array($result); //fill array with profile page info
echo (‘Welcome to ‘.$profileinfo); // write out the profile page
This will return a third party profile page if their username is passed, and the users own profile if no username is passed or their own is passed