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?


Expanding on the code i gave you in the other thread at

PHP can do the redirect for you with a header rewrite – but, and this is important, the header rewrite only works if you have not yet outputted anything else so this PHP code needs to come at the very top of your php file with no whitespace before it

$id  = mysql_real_escape_string($_GET);
$sql = "SELECT * FROM users WHERE id=$id";
$result = mysql_query($sql);

if (mysql_num_rows($result)==0) {
echo ('User never existed');
else if (mysql_num_rows($result)==1) {
$userinfo = mysql_fetch_array($result);
if (!$userinfo) {
echo ('User no longer exists.');
else {
$username = $userinfo;