Hello All,
I have a form that I created for user login.
It has three fields.
username
Password
Date
I want the date field to default to the current date when users login.
Can anyone help me with setting a default value for the date field?
Thanks in Advance!

Stick

<?php
$script_dt = date('Y-m-d'); //Modify formatting for your needs.
?>
<input type="text" name="userdate" value="<?= $script_dt ?>" />

See http://us2.php.net/manual/en/function.date.php for more about date formatting.

Troy,
Thanks for your help. It worked great. I ended up getting rid of the date field all together, and sending the script_dt variable directly to the table. So now when someone logs in I can see the date and time.
Thanks again for your help!
Stick

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.