Hmm... i have an odd feeling I just posted that code yesterday :-)...
Yes, it looks correct. BUT: it will only work if someone visits http://www.ph8web.com/ or http://www.magiceyedesign.com/. It won't work if they don't put in the "www".
To make .ph8web.com and .magiceyedesign.com work, use eregi:
// remove the whole switch block
// then add this:
if(eregi('ph8web.com$', $domain)) {
Header("Location: /ph8web");
}
else if(eregi('magiceyedesign.com$', $domain)) {
Header("Location: /magiceye");
}
else {
print "Invalid domain!";
}
The $ at the end of the domain indicates that there CANNOT be any more characters AFTER the .com. So anything.ph8web.com will be matched.
You can add more domains by adding in another "else if" clause right before the final else clause like this:
if(eregi('ph8web.com$', $domain)) {
Header("Location: /ph8web");
}
else if(eregi('magiceyedesign.com$', $domain)) {
Header("Location: /magiceye");
}
else if(eregi('anotherdomain.com$', $domain)) {
Header("Location: /anotherdomain");
}
else {
print "Invalid domain!";
}
good luck!
-sridhar