Hi all,
i was hoping for some technical help using php and mysql.
I have a simple database connected (mysql) and website (php/html).
A form of this website involves me inputting a date field in it. i have created a date function using the following javascript code:
var todaysdate = new Date();
year = todaysdate.getFullYear();
month = todaysdate.getMonth();
date = todaysdate.getDate();
day = todaysdate.getDay();
var monthname = new Array(“01″,”02″,”03″,”04″,”05″,”06″,”07″,”08″,”09″,”10″,”11″,”12”);
var dayname = new Array(“Sunday”,”Monday”,”Tuesday”,”Wednesday”,”Thursday”,”Friday”,”Saturday”);
The date is inserted into the webpage using the following code:
.
Basically i want to be able to insert this javascript date (by default) into the date field of my form, using the php echo method, if it is possible????
Example:
document.writeln(year+”-“+monthname[month]+”-“+date);
?>
Please help as this is doing my head in!!!!!
Thank You
tom