php - posting hidden value -
hey there, have 3 pages: (1) bookingfacilities.php (2) booking_now.php (3) successfulbooking.php , link together.
i want pass data bookingfacilities.php successfulbooking.php using hidden field/value. however, data doesn't print out in successfulbooking.php.
here codes:
from 'booking_now.php':
$date="$day-$month-$year";
from 'successfulbooking.php';
<input type="hidden" name="date" id="hiddenfield" value="<?php print "$date" ?>"/>
i appreciate project due tomorrow :(
you should never assume register_global_variables
turned on. if is, it's deprecated , should never use way.
refer directly $_post
or $_get
variables. form posting, you'd want code along lines of this:
<input type="hidden" name="date" id="hiddenfield" value="<?php echo $_post['date'] ?>" />
if doesn't work right away, print out $_post
or $_get
variable on page have hidden form field , determine want , refer it.
echo "<pre>"; print_r($_post); echo "</pre>";
Comments
Post a Comment