Re: New Newbie Question
| From: | Ronald \"The Newbie\" Allen | Date: | Sat, 15 May 2004 12:46:30 +0000 |
| Subject: | Re: New Newbie Question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186299@lists.php.net to get a copy of this message | ||
I haved removed the quotes and when it is by itself it works just fine
$date = date("Y-m-d H:i");
echo "$date";
2004-05-15 16:20
but I put it in a a form it only displays the date and not the time
Time:<INPUT type="text" name="Date_and_Time" value=<? echo $date; ?>
size="50"><br>
still only displays
2004-05-15
"Torsten Roehr" <roehr@zilleon.com> wrote in message
news:20040515123732.31422.qmail@pb1.pair.com...
> "Ronald "The Newbie" Allen" <sesel@omantel.net.om> wrote in message
> news:20040515123042.6047.qmail@pb1.pair.com...
> > Here is my problem:
> > When I get the value of $date and I echo it it shows up just fine
> >
> > $date = date("Y-m-d H:i");
> > echo "$date";
> > 2004-05-15 16:20
> >
> > but when I go to insert the value into a form like this
> >
> > Time:<INPUT type="text" name="Date_and_Time" value=<? echo
> > "$date"; ?>
> > size="50"><br>
> > it only displays
> > 2004-05-15
> >
> > why is this?????????
> > Annoying
>
> Looks like you are missing the closing > for your value attribute (see
> below).
>
> >
> >
> > <html>
> >
> > <title>
> > Master Station Log
> > </title>
> > <body text="#000000" link="#0000ff" vlink="#800080"
> > alink="#ff0000">
> > <?
> > $date = date("Y-m-d H:i");
> > echo "$date";
> > ?>
> >
> > Time:<INPUT type="text" name="Date_and_Time" value=<? echo
> > "$date"; ?>
> > size="50"><br>
> > </body
> > </html>
>
> Don't put quotes around your variables.
>
> echo $date;
>
> <INPUT type="text" name="Date_and_Time" value=<? echo $date;
> ?>>
size="50">
> (Pay attention to ?>>)
>
> Regards, Torsten