Henry Grech-Cini wrote:

Hi All,

I want to randomly select a desitniation page and use cookies to ensure that
refreshes and return visits on the same machine always return to that
desination (assuming the cookie is intact).

Imagine that we have an array of URL's

$url=array(1=>"dest1.html", "dest2.html", "dest3.html"); // I'm using the
1=> so that I don't need to store 0 in a cookie!

and that we have a variable $index which has a value in it (either set to a
cookie value, if this is a refresh or return visit, or a random value [1-3]
if this is the first visit

My question is are there problems with:

<?php
header("Location: ".$url[$index]);
?>

Might some browsers fail to redirect to the required destination?
If so under what circumstances?

In this example, it will not work because Location: expects the target to be a fully qualified URL.


Other than that, I don't see why it wouldn't work.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to