lildog Posted September 19, 2008 Share Posted September 19, 2008 I hope someone can shed some light on something for me. I put a snippet of code below. If a checkbox(today_date) is checked I want the current date put into $ustamp, when I echo ustamp or try to compare it to another date variable it is empty. BUT when I insert it into my DB it puts the correct date. So it appears to be a null variable but it is not...... if ($HTTP_POST_VARS['today_date']){ $utstamp =date("Y-m-d H:M:S"); } Thanks for any help or pointers, lildog Link to comment Share on other sites More sharing options...
♥FWR Media Posted September 19, 2008 Share Posted September 19, 2008 I hope someone can shed some light on something for me. I put a snippet of code below. If a checkbox(today_date) is checked I want the current date put into $ustamp, when I echo ustamp or try to compare it to another date variable it is empty. BUT when I insert it into my DB it puts the correct date. So it appears to be a null variable but it is not...... if ($HTTP_POST_VARS['today_date']){ $utstamp =date("Y-m-d H:M:S"); } Thanks for any help or pointers, lildog Well date("Y-m-d H:M:S"); is wrong for starters. example: date("Y-m-d H:i:s"); Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
lildog Posted September 19, 2008 Author Share Posted September 19, 2008 Thank you, That is much better, I also left a character out of the variable when checking it. Stupid mistake. Your advice led me there. Thanks a bunch, lildog Link to comment Share on other sites More sharing options...
skunkbad Posted September 20, 2008 Share Posted September 20, 2008 If you browse the php.net site, you can find all kinds of good info about the date(), strtotime(), and other date/time related functions, and you will find that other people have already done most of the work for you in the examples underneath the description of each function. No Links To My Website Here! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.