Hi, I would like to create a page that will redirect to one of my landing pages (for split testing) Ideally the pages would NOT have to be in the same directory. If anyone could help me with this I would much appreciate it! Thanks
Are you looking for something like this? $pages = array('page1.php', 'page2.php', 'dir/page3.php'); header('Location: ' . array_rand($pages)); PHP:
I don't know php but if that is a page rotation script then yes! will this one be able to point to pages in different directories?
The code I posted has a bug. Here is the corrected code. Sorry about the haste. <?php $pages = array('page1.php', 'page2.php', 'dir/page3.php'); header('Location: ' . $pages[array_rand($pages)]); ?> PHP: