View Full Version : Hidden Form Fields

03-29-2003, 02:58 PM

I'm new to PHP;)

I have a html page with a form on. I would like the values from teh form to be hidden in the next form (i.e. the page that the first form posts to). When I try I get undefined variable.

Here's my code:

html page:

<form name="form" method="post" action="test2.php">
<Select name="cbotest">
<option value="">Choose an option</option>
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
<option value="four">Four</option>


<input type="hidden" name="cbotest" value="<?php print $cbotest?>">

This is the result:

<input type="hidden" name="cbotest" value="<br />
<b>Notice</b>: Undefined variable: cbotest in <b>**removed**</b> on line <b>151</b><br />

I have removed where the script is :) Any ideas?

03-29-2003, 03:39 PM
All sorted :)

just needed a - $cbotest= $_POST['cbotest'];