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

PHP checkbox with date value

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP checkbox with date value

Postby karina1717 » Thu May 02, 2013 12:21 pm

Hi everybody, I'm trying to create checkboxes that will have the value of today's date, tomorrows date, etc. These should, of course, update as the date changes through php. What would this look like using west coast time? Here is what it looks like now:

<input name="booked" type="checkbox" id="booked" value="the date should be updating to today's date" />
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Nov 25, 2010 11:18 am

Re: PHP checkbox with date value

Postby sandeep605085 » Fri May 03, 2013 12:42 am


It should be like
<input name="booked" type="checkbox" id="booked" value="<?php echo date('m/d/Y H:i:s'); ?>" />

Below is the reference for date function of php, you can check this to get the exact format of date you want it to be.

Sandeep Agrawal
Mindfire Solutions
User avatar
New php-forum User
New php-forum User
Posts: 44
Joined: Tue Feb 26, 2013 6:00 am
Location: Mindfire Solutions

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

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