Credit Card Consolidation - Mortgage Calculator - Electricity Suppliers - Debt Consolidation - Wire Transfer

PDA

View Full Version : Please check this code?!


martyn11post
Mar 21st 2008, 2:15 pm
<?php $rnd = rand(1, 10);
$filename = "ads" . $rnd;

$url = $HTTP_SERVER_VARS['SERVER_NAME'] . $HTTP_SERVER_VARS['REQUEST_URI'];



switch ($url) {
case "www.moneymakingstudent.co.uk/index.php":
include ("http://www.purplesunset.co.uk/main/basic/matchedindex.php");
break;
case "www.moneymakingstudent.co.uk/":
include ("http://www.purplesunset.co.uk/main/basic/matchedindex.php");
break;
default:
include ("http://www.purplesunset.co.uk/main/basic/$filename.php");
break;
};
?>


For some reason only the default is being shown, I am using wordpress, not sure if that is causing the problem?

Any help or suggestions would be great,

Many thanks
Martyn:confused:

Cybernaut
Mar 21st 2008, 3:11 pm
Try this:

$url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

martyn11post
Mar 21st 2008, 3:15 pm
Thanks Cybernaut, that worked! :)