for example if I have a box where you should put a date how do I keep
today date inside that box as default? 13 2731
You can do something like this, using the date function of PHP: http://us3.php.net/date
$html = "<input type=\"text\" value=\"".date("m-d-Y")."\" />";
dsp...@gmail.com wrote: You can do something like this, using the date function of PHP: http://us3.php.net/date
$html = "<input type=\"text\" value=\"".date("m-d-Y")."\" />";
I would use single quotes here and avoid so many confusing
backslashes...
$html = '<input type="text" value="' . date("m-d-Y") . '" />';
I find this much easier to read.
Ken
"Ken Robinson" <ke******@rbnsn.com> wrote in news:1113401556.678161.246480
@l41g2000cwc.googlegroups.com: I would use single quotes here and avoid so many confusing backslashes...
$html = '<input type="text" value="' . date("m-d-Y") . '" />';
I find this much easier to read.
if we're on an "easier to read" tip, call me crazy, but I prefer to keep my
functions and variables kind of seperate. i'd make it into two lines:
$thedate = date("m-d-Y");
$html = "<input type=\"text\" value=\"$thedate\" />";
Good Man <he***@letsgo.com> wrote: I would use single quotes here and avoid so many confusing backslashes...
$html = '<input type="text" value="' . date("m-d-Y") . '" />';
I find this much easier to read.
if we're on an "easier to read" tip, call me crazy, but I prefer to keep my functions and variables kind of seperate. i'd make it into two lines:
$thedate = date("m-d-Y"); $html = "<input type=\"text\" value=\"$thedate\" />";
With the "easier to read (and write)" (tm) version being:
$html = "<input type='text' value='$thedate' />";
One quick glance of an experienced eye allowed to understand the blurred
and almost unreadable Daniel Tryba's handwriting: Good Man <he***@letsgo.com> wrote: I would use single quotes here and avoid so many confusing backslashes...
$html = '<input type="text" value="' . date("m-d-Y") . '" />';
I find this much easier to read.
if we're on an "easier to read" tip, call me crazy, but I prefer to keep my functions and variables kind of seperate. i'd make it into two lines:
$thedate = date("m-d-Y"); $html = "<input type=\"text\" value=\"$thedate\" />";
With the "easier to read (and write)" (tm) version being: $html = "<input type='text' value='$thedate' />";
And just to be annoying on this, I always capitalize the HTML tags,
therefore:
$thedate = date("m-d-Y");
$html = "<INPUT type='text' value='$thedate' />";
:)
Cheers
Mike
Micha? Wo?niak <mikiwoz_remove_this@yahoo_remove_this.co.uk> wrote: With the "easier to read (and write)" (tm) version being: $html = "<input type='text' value='$thedate' />";
And just to be annoying on this, I always capitalize the HTML tags, therefore: $thedate = date("m-d-Y"); $html = "<INPUT type='text' value='$thedate' />"; :)
It's an XHTML style element, and xhtml specs say: http://www.w3.org/TR/xhtml1/#h-4.2
One quick glance of an experienced eye allowed to understand the blurred
and almost unreadable Daniel Tryba's handwriting: Micha? Wo?niak <mikiwoz_remove_this@yahoo_remove_this.co.uk> wrote: With the "easier to read (and write)" (tm) version being: $html = "<input type='text' value='$thedate' />";
And just to be annoying on this, I always capitalize the HTML tags, therefore: $thedate = date("m-d-Y"); $html = "<INPUT type='text' value='$thedate' />"; :)
It's an XHTML style element, and xhtml specs say: http://www.w3.org/TR/xhtml1/#h-4.2
As I said: "I always capitalize HTML tags"
^^^^
and INPUT is also a HTML 4.xx element: http://www.w3.org/TR/html4/interact/forms.html#h-17.4
Cheers
Mike
and my $.02
I believe the HTML spec requires values surrounded by "s not 's
and in general, my nictpick is to surround strings with 's so that PHP
won't parse them
so, I'll side with Ken's post above:
$thedate = date('m-d-Y');
$html = '<INPUT type="text" value="'.$thedate.'" />';
"BKDotCom" <bk***********@yahoo.com> wrote in news:1113414323.608892.170440
@l41g2000cwc.googlegroups.com: and my $.02 I believe the HTML spec requires values surrounded by "s not 's and in general, my nictpick is to surround strings with 's so that PHP won't parse them so, I'll side with Ken's post above:
but what are you doing with all your other variables? consistency is a
good thing... are your other variables really using single quotes like:
$name = 'Hank Azaria';
$address = '188 Burlington Road';
??
and if so, what happens when you have a name/address with an apostrophe
(ie: Mike O'Malley living at 87 O'Donell Avenue)? I thought it was good
form to use double-quotes in PHP just about *all* the time?
On 2005-04-13, Good Man <he***@letsgo.com> wrote: and if so, what happens when you have a name/address with an apostrophe (ie: Mike O'Malley living at 87 O'Donell Avenue)?
Then you escape it. What happens if you use a double-quoted string and
put a double-quote in it? Same thing.
I thought it was good form to use double-quotes in PHP just about *all* the time?
Not really. Double-quotes means "evaluate me". Example in "Hello $world"
$world is evaluated. And also if you put in a newline or a tab it will
be "evaluated". Whereas single-quote means "do not evaluate me" so
variables and special characters like newline will not be evaluated.
Wether you use one or the other is primarily a matter of taste in the
cases where you don't use evaluation.
--
Cheers
- Jacob Atzen
Michał Woźniak wrote: One quick glance of an experienced eye allowed to understand the blurred and almost unreadable Daniel Tryba's handwriting:
Micha? Wo?niak <mikiwoz_remove_this@yahoo_remove_this.co.uk> wrote:
With the "easier to read (and write)" (tm) version being: $html = "<input type='text' value='$thedate' />";
And just to be annoying on this, I always capitalize the HTML tags, therefore: $thedate = date("m-d-Y"); $html = "<INPUT type='text' value='$thedate' />"; :)
It's an XHTML style element, and xhtml specs say: http://www.w3.org/TR/xhtml1/#h-4.2
As I said: "I always capitalize HTML tags" ^^^^ and INPUT is also a HTML 4.xx element: http://www.w3.org/TR/html4/interact/forms.html#h-17.4
Yes, but in that case you should write
"<INPUT type='text' value='$thedate'>"
rather than
"<INPUT type='text' value='$thedate' />"
right?
JP
--
Sorry, <de*****@cauce.org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
One quick glance of an experienced eye allowed to understand the blurred
and almost unreadable Jan Pieter Kunst's handwriting: Micha³ Wo¼niak wrote: One quick glance of an experienced eye allowed to understand the blurred and almost unreadable Daniel Tryba's handwriting:
Micha? Wo?niak <mikiwoz_remove_this@yahoo_remove_this.co.uk> wrote:
>With the "easier to read (and write)" (tm) version being: >$html = "<input type='text' value='$thedate' />";
And just to be annoying on this, I always capitalize the HTML tags, therefore: $thedate = date("m-d-Y"); $html = "<INPUT type='text' value='$thedate' />"; :)
It's an XHTML style element, and xhtml specs say: http://www.w3.org/TR/xhtml1/#h-4.2
As I said: "I always capitalize HTML tags" ^^^^ and INPUT is also a HTML 4.xx element: http://www.w3.org/TR/html4/interact/forms.html#h-17.4
Yes, but in that case you should write
"<INPUT type='text' value='$thedate'>"
rather than
"<INPUT type='text' value='$thedate' />"
right?
JP
Ooops, missed that, thanks. :)
Cheers
Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tavish Muldoon |
last post by:
What a pain trying to insert data into a table from a stored proc. My
webform asks for 16 pieces of data - which then gets written to the
database.
I found this easier than the crap below...
|
by: shank |
last post by:
I'm trying to use online samples for submitting multiple records from ASP
into a stored procedure. Failing! Through the below form, a user could be
submitting many records at a time. I'm not...
|
by: solomon_13000 |
last post by:
connection.asp:
<%
Sub RunQueryString (pSQL,parms)
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &...
|
by: Tarik Monem |
last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong
casting_registration.php
<table>
<tr>
<td>
<form enctype="multipart/form-data" action="thankyou.php"...
|
by: bodilima |
last post by:
Dear All,
I'm new to this!
I wanna insert selected values from form "SaveModel" to form "SaveMake" <input name="makeID" value="<<<<need to insert here(x)>>>>">
&
<input name="make"...
|
by: annerhexian |
last post by:
hi to all
i am confused right now.. im just new in php.. and i have syntax error in my codes.. pls take a look?
database name: ranking
table: form1
fields: form1academicbachelor
...
|
by: bonneylake |
last post by:
Hey Everyone,
Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
|
by: wizardry |
last post by:
hello -
i'm trying to insert a blob into my table, it will insert but the string that i insert when i query the inserted data returns null with 0 bytes in the column.
I have other tables set...
|
by: tarunkhatri |
last post by:
Hi,
I want to insert multiple rows in a database table, from an submit form. But not able to trouble shoot the problem in my code. Following is the code.
<form action=test_insert.php...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |