buckky
12-28-2007, 10:32 PM
okay what ive got is a page using if/elseif php based on a var from the previous page to determine if and where to redirect. the redirect is not associated with the submit button, in fact they are mutually exclusive by the if/elseif. what i need to do is submit form data to the redirected pages from the previous page, or the current page(the one with the redirects). i already use another if/elseif to change the action url in the form tag. but on refresh it does not submit the posted data. im a bit stuck.. heres in essence whats going on..
<html>
<body>
<LINK REL="stylesheet" HREF="xyz.css">
<?php
$select = $_POST['select'];
$var1 = $_POST['var1'];
$var2 = $_POST['var2'];
$var3 = $_POST['var3'];
$var4 = $_POST['var4'];
if ($select == a){echo"<FORM ACTION=\"xyz1.php\" method=post>";}
elseif ($select == b) {echo"<FORM ACTION=\"xyz2.php\" method=post>";}
elseif ($select == c) {echo"<FORM ACTION=\"xyz3.php\" method=post>";}
elseif ($select == d) {echo"<FORM ACTION=\"xyz4.php\" method=post>";}
if ($select == a)
{echo"page content for dispay if select is a";}
elseif ($select == b) {echo"
<meta http-equiv=\"refresh\" content=\"0;url=http://xyz.com/xyz2.php\">
";}
elseif ($select == c) {echo"
<meta http-equiv=\"refresh\" content=\"0;url=http://xyz.com/xyz3.php\">
";}
elseif ($select == d) {echo"
<meta http-equiv=\"refresh\" content=\"0;url=http://xyz.com/xyz4.php\">
";}
?>
<input type=hidden name="var1" value="<?php echo $var1;?>">
<input type=hidden name="var2" value="<?php echo $var2;?>">
<input type=hidden name="var3" value="<?php echo $var3;?>">
<input type=hidden name="var4" value="<?php echo $var4;?>">
</form>
</body>
</html>
as you can see what i dont know how to do is cause the form information to submit to the pages that the user is redirected to. and no i dont want them to see this page at all unless "select" value is a.
<html>
<body>
<LINK REL="stylesheet" HREF="xyz.css">
<?php
$select = $_POST['select'];
$var1 = $_POST['var1'];
$var2 = $_POST['var2'];
$var3 = $_POST['var3'];
$var4 = $_POST['var4'];
if ($select == a){echo"<FORM ACTION=\"xyz1.php\" method=post>";}
elseif ($select == b) {echo"<FORM ACTION=\"xyz2.php\" method=post>";}
elseif ($select == c) {echo"<FORM ACTION=\"xyz3.php\" method=post>";}
elseif ($select == d) {echo"<FORM ACTION=\"xyz4.php\" method=post>";}
if ($select == a)
{echo"page content for dispay if select is a";}
elseif ($select == b) {echo"
<meta http-equiv=\"refresh\" content=\"0;url=http://xyz.com/xyz2.php\">
";}
elseif ($select == c) {echo"
<meta http-equiv=\"refresh\" content=\"0;url=http://xyz.com/xyz3.php\">
";}
elseif ($select == d) {echo"
<meta http-equiv=\"refresh\" content=\"0;url=http://xyz.com/xyz4.php\">
";}
?>
<input type=hidden name="var1" value="<?php echo $var1;?>">
<input type=hidden name="var2" value="<?php echo $var2;?>">
<input type=hidden name="var3" value="<?php echo $var3;?>">
<input type=hidden name="var4" value="<?php echo $var4;?>">
</form>
</body>
</html>
as you can see what i dont know how to do is cause the form information to submit to the pages that the user is redirected to. and no i dont want them to see this page at all unless "select" value is a.