HighDots Forums  

Re: inserting into db from hidden field

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Re: inserting into db from hidden field in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gary White
 
Posts: n/a

Default Re: inserting into db from hidden field - 07-08-2003 , 12:03 PM






On Tue, 8 Jul 2003 16:44:16 +0200, "awebb" <andywebb25 (AT) hotmail (DOT) com>
wrote:

Quote:
I'm trying to insert a date/time value into my db by using a hidden field.
This is the current code:

?php $time=gmdate("Y/m/d H:i:s"); ?
td colspan="3" align="center"><input type="hidden" name="booktime"
value="$time"></td

But it won't produce a result in the db.
I'm curious why you are using an entire table cell for a hidden field,
but that's another question. ;-)

The following line is not inside a PHP code block:
<input type="hidden" name="booktime" value="$time">

What that means is that "$time" is not evaluated and replaced before
the form is sent to the browser. If you look at the source code of
your form page, you'll see it's just the string "$time". Try it this
way:

<input type="hidden" name="booktime" value="<?=$time;?>">


Gary


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.