adairwu
asked on
More than one level redirect in php
Hi Experts,
I am wondering if I can have 2 or more redirect in the same browser using php?
for example, from webpage A, I need to redirect the browser to page B1 and then page B2. I know I can use header("Location: PageB1"); to redirect from A to B1 but page B1 is not on my website and I need the customer go to B1 and then B2.
How about A->B1->B2->B3...? is it possible?
Thanks in advance
I am wondering if I can have 2 or more redirect in the same browser using php?
for example, from webpage A, I need to redirect the browser to page B1 and then page B2. I know I can use header("Location: PageB1"); to redirect from A to B1 but page B1 is not on my website and I need the customer go to B1 and then B2.
How about A->B1->B2->B3...? is it possible?
Thanks in advance
This is not possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You may be able to use AJAX technology to accomplish something like this as well.
a1.php
--------
<?php
session_start();
$_SESSION["pages"]=array(" a2.php","a 3.php");
if (count($_SESSION["pages"]> 0)) {
$first=$_SESSION["pages"][ 0];
$_SESSION["pages"]=array_s hift($_SES SION["page s"]);
echo "<script>location.href='$f irst'</scr ipt>";
}
?>
a2.php with same code it goes till the end...
--------
<?php
session_start();
if (count($_SESSION["pages"]> 0)) {
$first=$_SESSION["pages"][ 0];
$_SESSION["pages"]=array_s hift($_SES SION["page s"]);
echo "<script>location.href='$f irst'</scr ipt>";
}
?>
-------
--------
<?php
session_start();
$_SESSION["pages"]=array("
if (count($_SESSION["pages"]>
$first=$_SESSION["pages"][
$_SESSION["pages"]=array_s
echo "<script>location.href='$f
}
?>
a2.php with same code it goes till the end...
--------
<?php
session_start();
if (count($_SESSION["pages"]>
$first=$_SESSION["pages"][
$_SESSION["pages"]=array_s
echo "<script>location.href='$f
}
?>
-------