Jump to content

date (strtotime) not working ...


shane85

Recommended Posts

I have a drop down so that the options of when to contact next can be chosen. I am using strtotime to do it but its just entering a blank field into my db. The code is as follows for the drop down

 

<select name="contact_next" id="contact_next" class="textfield">
	<option value="#" >Please Choose</option>
	<option value="<?php date('Y-m-d', strtotime('+1 day')); ?>">1 Day</option>
	<option value="<?php date('Y-m-d', strtotime('+2 day')); ?>">2 Days</option>
	<option value="<?php date('Y-m-d', strtotime('+3 day')); ?>">3 Days</option>
	<option value="<?php date('Y-m-d', strtotime('+1 week')); ?>">1 Week</option>
	<option value="<?php date('Y-m-d', strtotime('+2 week')); ?>">2 Weeks</option>
	<option value="<?php date('Y-m-d', strtotime('+3 week')); ?>">3 Weeks</option>
	<option value="<?php date('Y-m-d', strtotime('+1 month')); ?>">1 Month</option>
	<option value="<?php date('Y-m-d', strtotime('+2 month')); ?>">2 Months</option>
	<option value="<?php date('Y-m-d', strtotime('+3 month')); ?>">3 Months</option>
	<option value="<?php date('Y-m-d', strtotime('+6 month')); ?>">6 Months</option>
	</select>

 

If I just echo

<?php echo date('Y-m-d', strtotime('+6 month'));

 

it works perfectly. How come it isnt working and storing into my db???

Link to comment
https://forums.phpfreaks.com/topic/197679-date-strtotime-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.