problem with $_POST

From: Date: Mon, 16 Sep 2002 11:37:09 +0000
Subject: problem with $_POST
Groups: php.general 
Request: Send a blank email to php-general+get-116506@lists.php.net to get a copy of this message
Hi all, I hope someone could help me with this code: <? include("headfile.php"); function one(){ ?> <table align="center" width="45%"> <tr><td> Select product: </td></tr> <form action="" method="post" name="one"> <tr><td> <p> <label> <input type="radio" name="product" value="d1"> Product One</label> <br> <label> <input type="radio" name="product" value="d2"> Product Two</label> <br> </td></tr> <tr> <td><input type="submit" name="nextone" value="Next &gt;&gt;&gt;"></td> </tr> </form> </table> <? } function twoOptionA(){ ?> <table align="center" width="45%"> <form action="" method="post" name="optionA"> <tr><td> Select product: </td></tr><br> <tr> <td width="45%"> <p><br> <label> <input type="radio" name="productOA" value="e1"> Product One (A)</label> <br> <label> <input type="radio" name="productOA" value="e2"> Product One (B)</label> <br> <label> <br></p></td></tr> <tr align="center"><td><br> <input type="submit" name="nextoptionA" value="Next &gt;&gt;&gt;"> </td></tr> </form> </table> ?> } function twoOptionB(){ // like function TwoOptionA with differents Products } function three(){ $prodel=$_POST['prod']; ?> <table width="70%" align="center"> <form action="" name="three" method="post"><tr><td> The Product is: </td></tr> <tr><td> <? echo $prodel; ?> </td></tr><br><br> <tr align="center"><td><br><br><font size="-1">Insert your name:</font><br> <input name="nameperson" type="text" size="40" maxlength="100"> </td></tr> <tr align="center"><td> <input type="submit" name="nextthree" value="Next &gt;&gt;&gt;"> </td></tr> </form> </table> <? } function four(){ $thor1=$_POST['prod']; $thor2=$_POST['period']; $thor3=$nameperson; ?> <table width="70%" align="center"> <form action="" name="four" method="post"> <tr valign="top"><td> The Product is: </td></tr> <tr valign="top"><td> <? echo $thor1; ?> </td></tr><br><br> <tr valign="top"><td> Period is: <? echo $thor2; ?> </td></tr> <tr valign="top"><td> Your name is: </td></tr><br> <tr valign="top"><td> <? echo $thor3; ?> </td></tr><br><br> <tr align="center"><td> <input type="submit" name="nextfour" value="Next &gt;&gt;&gt;"> </td></tr> </form> </table> <? } if(isset($nextfour)) { //other things } elseif(isset($nexthree)) { $passing=$_POST['register']; /*All work well until i try to pass any value to variable $passing. I can't see any value in function four()*/ if($passing == q1) { $_POST['prod']="Product One (A)"; $_POST['period']="Anual"; four(); } elseif($passing == q2) { $_POST['prod']="Product One (B)"; $_POST['period']="Bianual"; four(); } elseif(isset($nextoptionA)) { if($productOA == e1) { $_POST['register']="q1"; $_POST['prod']="Product One (A)"; $_POST['period']="Anual"; three(); } elseif($productOA == e2) { $_POST['register']="q2"; $_POST['prod']="Product One (B)"; $_POST['period']="Bianual"; three(); } } elseif(isset($nextone)) { if($product == d1) { twoOptionA(); } elseif($product == d2) { twoOptionB(); } } else { // main function. } ?> What am i doing wrong? Thanks for help in advance. Peace & Love skitum

« previous php.general (#116506) next »