Great, I got it working --- mostly. It only works if $HTTP_HOST matches exactly what I have in the database. So if I have the www. in the db, and don't put that in the URL, it won't work. Is there any way that I can fix this?
PHP Code:
$headinfo = mysql_query("SELECT id FROM agents where agenturl='$HTTP_HOST'",$link);
if (!$headinfo) {
echo("<P>Error retrieving agent from database!<BR>". "Error: " . mysql_error());
exit();
}
$headinfo_redirect = (mysql_fetch_array($headinfo));
$id=$headinfo_redirect[id];
if ($id) {
$agent=$id;
}
Thank you again.
Bookmarks