Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Date and time in php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Date and time in php

Postby zainmr89 » Mon Jun 03, 2013 3:42 am

How to add time in mysql database from a textbox.

<form name="addTime" action="<?php echo $SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="time" />
<input type="submit" name="enterTime" />
</form>
zainmr89
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Jun 03, 2013 3:21 am

Re: Date and time in php

Postby developerahusain » Mon Jun 03, 2013 9:07 am

<form name="addTime" action="<?php echo $SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="time" value="<? echo date('l, F j, Y ')."&nbsp;".date ("h:i:s") ?>" />
<input type="submit" name="enterTime" />
</form>

Here is the code friend

developerahusain. Any other problem do revert
developerahusain
New php-forum User
New php-forum User
 
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: Date and time in php

Postby johnmacd » Thu Jun 13, 2013 10:51 pm

establish connection with database.
then take the value in text box in variable $time=$_REQUEST["time"];
then using insert query insert data into database.
johnmacd
New php-forum User
New php-forum User
 
Posts: 19
Joined: Wed Jun 12, 2013 9:30 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.