I have "wildcard dns" setup on my site www.blastphoto.com so anythinghere.blastphoto.com will work. I wrote a simple script that reads what the user enters (ie. "uniqueuser.blastphoto.com") and then redirects them to the appropriate page (ie. "www.blastphoto.com/users/uniqueuser"). For whatever reason it only works 30% of the time!!!
... any ideas?
list($first) = explode('.', $_SERVER["HTTP_HOST"]);
$result = mysql_query("SELECT * FROM users") or die ("Invalid query");
while($row = mysql_fetch_array($result)){
if($row[user] == $first){
$redirecturl = "http://www.blastphoto.com/users/" . $row[user] . "/";
Header("Location: $redirecturl");
}
}