adding php variables in hidden value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scout3014
Forum Newbie
Posts: 4
Joined: Wed Jul 25, 2007 3:51 am

adding php variables in hidden value

Post by scout3014 »

Hi all

I need help on one matter here. I have a php file which takes values
from the form which calls the page and displays it for confirmation. I
try to display using this:

Code: Select all

From: <input name="start" type="hidden" value="<?php echo $startDate; ?>" >

The reason behind this is that after confirmation this page will have
a form action that calls another page to store the hidden variables
into the database, but the above line will not display the value
$startDate, does anyone know why?

Thanks
dream2rule
Forum Contributor
Posts: 109
Joined: Wed Jun 13, 2007 5:07 am

Post by dream2rule »

On the other page, retrieve the startDate value as

Code: Select all

$startDate = $_POST['start'];
echo $startDate;
Hope this solves your problem.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

$startDate, does anyone know why?
Because the input type is hidden, do a view source on the browser, you might be able to find the date
Post Reply