looking for a brokerage account or IRA... click here Add To Favorites
return to index 

Automatically Redirect People To Different Landing Pages in PHP

In an effort to differentiate my blog and other resources from my previous endeavors, I am deploying rudimentary A:B switches on entry to the site. Basically, consumer A is sent to landing page 1 and consumer B is sent to landing page 2. I am able to do this by parsing the incoming URL.

The simplest application would be to hard-code a few domains. e.g.

$ref=strtolower($_SERVER["HTTP_REFERER"]);
if((strstr($ref,"php") || strstr($ref,"host")) && !strstr($ref,"andrewkimball.com"))
{  
  header("Location: SQLAndCSharpStuff.php");
}

Smarter websites could do database lookups, set cookies, look at IPs, etc. All are rather straight forward, but are more complicated than I need for the basic setup.

Additional Interesting Articles

Execute Files Remotely Using PSExec
Block File Leechers Using PHP
C# MailMessage Example
t-SQL Cursor
PHP Cookie And Authentication
Regex C# HTML

©2008 AndrewKimball.com