473,396 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PHP Date problem

On our companies website have have several pages that submit to a
database that php provides the date automatically. One page, however,
will not. This page is generated by a database search and have 5 fields
that are added and then updated in the database. One of these fields is
the date.

<INPUT NAME="daterepaired" TYPE="text" VALUE="<?php echo date("M d,
Y")" ?>; SIZE="15">

This doesn't work. It displays a box with <?php echo date( in it. I
have tried replacing " with ' with no difference. I'm beginning to
think that it is because the page this is on is generated from a php
search script. This code works for me on the other pages. Anyone have
any suggestions or alternatives?

Thanks for your help,

Greg

Jul 17 '05 #1
6 1229
Greg wrote:
<INPUT NAME="daterepaired" TYPE="text" VALUE="<?php echo date("M d,
Y")" ?>; SIZE="15">


Switch the semi-colon with the double-quote before it.

--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 17 '05 #2
Greg wrote:
<INPUT NAME="daterepaired" TYPE="text" VALUE="<?php echo date("M d,
Y")" ?>; SIZE="15">

This doesn't work. It displays a box with <?php echo date( in it.


sounds like the file isn't PHP parsed.

--
Jock
Jul 17 '05 #3
Sorry, typo on my part. Below is how it is on the site.

<input name="daterepaired" type="text" value="<?php echo date("M d,
Y");?>" size="15">

Would the fact that the page this is on being generated by a script
have any effect on it?

Thanks,

Greg

Jul 17 '05 #4
On 2 Jun 2005 16:36:48 -0700, Greg wrote:
Would the fact that the page this is on being generated by a script
have any effect on it?


Sure. The script generates output, which is sent to the browser. The
output is not magically scanned for php tags first. Instead of
outputting php code from the script, output what the php code would.
--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 17 '05 #5
if your html line is actually generated by php (as you hint) than it
should look like this

print '<input name="daterepaired" type="text" value="'.date("M d,
Y").'" size="15">';

result in the browser:
<input name="daterepaired" type="text" value="Jun 03, 2005" size="15">

micha

Jul 17 '05 #6
This did the trick. Thanks for your help.

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
7
by: martini | last post by:
Need help: I am trying to call a DB2 stored procedure that requires parameters: 4x int, date, varchar, int. I use VB6 & oledb. I'm using statements: cmd.CommandText = "{call db2admin.proc(1, 0,...
11
by: David B | last post by:
I have 2 querys with the following in the date criteria Between DateAdd("m",-6,(!!)) And (!!) Between DateAdd("m",-24,(!!)) And DateAdd("m",-6,(!!)) Problem is they both look at the same...
3
by: Dustin Wilson | last post by:
I have a problem with the following line of code. rstOutput! = FormatDateTime("January 1, 2004", vbLongDate) When I run this on my computer at home it runs without problem but when I run it at...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
2
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
1
by: TN Bella | last post by:
Hello, I was looking through the older posts for a solution to this problem, but I am still confused on how to fix my problem. There are two dates on my form, one (txtInvDate) is entered by the...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
13
by: Jim Armstrong | last post by:
Hi all - This problem has been driving me crazy, and I'm hoping the answer is something stupid I am neglecting to see.... The procedure posted below is part of an Access/SQL database I have...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.