Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Nice Profile URL? Re: Nice Profile URL?

#96045
bungle
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