Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Dreamweaver /PHP Date question . . .

Options
  • 03-09-2005 10:23pm
    #1
    Registered Users 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 Posts: 9,196 ✭✭✭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 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 Posts: 148 ✭✭maco


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


Advertisement