Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Dreamweaver /PHP Date question . . .

  • 03-09-2005 09:23PM
    #1
    Registered Users, Registered Users 2 Posts: 148 ✭✭


    Hi,

    Hope somemone could help me, I have the following set ups;

    My SQL file fields: User Id, Password and date

    Dreamweaver form : User ID, Password, Date

    My question is how do I default the Date field to todays date ? Is there any simple way of doing it ? either by PHP or Javascript . .

    Note : still very new to these software.

    Thanks a lot . . .


Comments

  • Registered Users, Registered Users 2 Posts: 9,458 ✭✭✭RobertFoster


    Have a look at http://ie2.php.net/date

    Define $today in whatever format you prefer - then have the value of the date field like the following:
    [php]<input type="text" value="<?php echo("$today"); ?>">[/php]


  • Registered Users, Registered Users 2 Posts: 148 ✭✭maco


    Thanks for your email, but still not diplaying correctly, as I said I am still new to this, I could have miss some thing here . . . here is the code generated by dreamveaver

    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" onSubmit="MM_validateForm('email','','RisEmail','password','','R','datime','','R');return document.MM_returnValue">
    <table align="center">
    <tr valign="baseline">
    <td width="110" align="right" nowrap>Email:</td>
    <td width="212"><input type="text" name="email" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">Password:</td>
    <td><input type="text" name="password" value="" size="32"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right"> </td>
    <td> </td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">Register Date:</td>
    <td><input type="text" name="datime" value="<?php echo("$today"); ?>" size="20"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right"> </td>
    <td> </td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right"> </td>
    <td><div align="center">
    <input type="submit" value="Insert Record">
    </div></td>
    </tr>
    </table>
    <input type="hidden" name="MM_insert" value="form1">
    </form>


  • Registered Users, Registered Users 2 Posts: 148 ✭✭maco


    So sorry, got it already, forgot to define the field . . . . Thanks, you just saved me a lot if time. . .


Advertisement