Code:
$Username = $_SERVER['DOCUMENT_URI'];
$Username = str_replace("/", "", $Username);
$db = mysql_connect("server", "user", "pass");
@mysql_select_db("db",$db);
$sql = "SELECT UserID FROM Users WHERE Username = '$Username'";
$result = mysql_query($sql);
$row_rs_item = mysql_fetch_assoc($result);
if ($row_rs_item['UserID'] == ""){
header('location: [URL unfurl="true"]http://www.mydomain.com');[/URL]
exit;
}else{
$sql2 = "SELECT ID FROM Details WHERE UserID = '$row_rs_item[UserID]'";
$result2 = mysql_query($sql2);
$row_rs_item2 = mysql_fetch_assoc($result2);
$URL = "[URL unfurl="true"]http://www.mydomain.com/ido/designs/initial.php?ID="[/URL] . $row_rs_item2['ID'];
header('location: $URL');
exit;
}
mysql_close ($db);
This doesn't work I have no idea why, its a custom 404 page and its taking what the user is entering and then using that to login ie I am trying..
It then logs in using this... When i run it though it just doesn't do anything, no errors nothing, the outputs are all ok its just not actually redirecting.