Hi,
I are trying to mod rewrite my
profile.php?id=1 to
profile/Username
I have this code in my .htaccess
PHP Code:
RewriteEngine on
RewriteBase /
RewriteRule ^profile/(.*)$ profile.php?id=$1
and this code in my php file profile.php
PHP Code:
$url_parts = explode("/", $_GET['url']);
$friendly_name = $url_parts[0];
$friendly_name = mysql_real_escape_string($friendly_name);
$name = $friendly_name;
if($name != "" && $name != NULL)
{
$result = mysql_query("SELECT userid FROM user WHERE username='".$name."'");
if(mysql_num_rows($result) > 0)
{
$assoc = mysql_fetch_assoc($result);
$account = $assoc['id'];
}
else
{
echo'Does not exist';
}
}
$id == $account;
When i try to echo the users $id or even $name it will not echo ?
Can anyone help ?