Double Meta Refresh code help!

johnny2

Newbie
Joined
Aug 18, 2010
Messages
1
Reaction score
0
Hi I am trying to redirect to pages on my blog with this code:
<?php
$page1 = "myblog/wordpress/?p=22";
$page2 = "myblog/wordpress/?p=20";
$page3 = "myblog/wordpress/?p=18";
$page4 = "myblog/wordpress/?p=15"; $referer =
$_SERVER['HTTP_REFERER']; $mypages = array($page1,
$page2, $page3, $page4); $myrandompage =
$mypages[mt_rand(0, count($mypages) -1)]; if($referer ==
"") { echo "<meta http-equiv=\"refresh\"
content=\"0;url=$myrandompage\">"; } else { echo "<meta
http-equiv=\"refresh\" content=\"0;url=x.php\">"; } ?>

Is there anything wrong with it? (apart from the URLS) because it just returns an error. Could anyone here give me the correct code for me to insert my URLS?
 
Doesnt return an error for me.. although I doubt this works.. coz for meta refresh to blank referrer you need 2 files I think.
 
Code:
<?php
$page1 = "myblog/wordpress/?p=22";
$page2 = "myblog/wordpress/?p=20";
$page3 = "myblog/wordpress/?p=18";
$page4 = "myblog/wordpress/?p=15";
$referer =$_SERVER['HTTP_REFERER'];
$mypages = array($page1,$page2, $page3, $page4);
$myrandompage =$mypages[mt_rand(0, count($mypages) -1)];
if($referer =="")
	{
		echo "<meta http-equiv=\"refresh\" content=\"0;url=$myrandompage\">";
	} else {
		echo "<meta http-equiv=\"refresh\" content=\"0;url=x.php\">"; 
} ?>
 
Back
Top