Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty variables if browser back is used?

Status
Not open for further replies.

wudz

Programmer
Mar 28, 2001
135
GB
Hi,

Just found a bug and I am unsure of the answer.
I have a Select page with three radio buttons the page also has a menu choice.

If I choose a radio button and select a menu then submit all is well if the page is selected from the home page.

The problem is if the back button is used and another button choice is made on submit the button variables passed always resort back to the button 1 variable.

The menu is not really any problem even though it retains the past selection.

How can I clear the button if browser back is used even though the button does shows a different choice, it's attached variable is not picked up.

Cheers in anticipation
John
 
Sorry forgot to show the code used,,,

HTML

<A NAME=goto></A>
<FORM NAME=catform ACTION="<?=$_SERVER['PHP_SELF']?>#goto" METHOD="post">
<INPUT TYPE=HIDDEN NAME="action" VALUE="process">
<INPUT TYPE=HIDDEN NAME="box" VALUE="">

<tr>

<td width="40%" height="5" align = "center" BGCOLOR="#ccff33">
<INPUT TYPE=radio NAME=auctiontype VALUE="3" <? print $TPL_standard; ?>>
</td>


<td width="20%" height="5" align = "center" BGCOLOR="#ccff33">
<INPUT TYPE=radio NAME=auctiontype VALUE="2" <? print $TPL_dutch; ?>>
</td>


<td width="40%" height="5" align = "center" BGCOLOR="#ccff33">
<INPUT TYPE=radio NAME=auctiontype VALUE="4" <? print $TPL_classified; ?>>
</td>



PHP

// -------------------------------------- Select Auction type
if ( intval($auctiontype)==3 ) $TPL_standard = "CHECKED";
if ( intval($auctiontype)==2 ) $TPL_dutch = "CHECKED";
if ( intval($auctiontype)==4 ) $TPL_classified = "CHECKED";

$_SESSION["auction_type"] = $auctiontype;




if($_POST['action'] == 'process' && (intval($_SESSION["auction_type"]) <1 )) {
$TPL_error_text = $ERR_117b;
$sessionVars["returned"]= 'r';
Header("Location: select_category.php?mode=recall");


cheers

John
 
Sorted, set a $sessions variable that was already used!!!Fool am I..

Cheers

john
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top