ankur0101 Posted December 8, 2008 Share Posted December 8, 2008 Hi, I have made one form with following elements Name : Age : IP : hidden field Date : hidden field. How can i do that ? I am using dreamweaver Cs3 I know everything about forms with mySQL surface. But i am having problem in hidden elements IE IP and DATE PLease anybody, help me ... Link to comment https://forums.phpfreaks.com/topic/136027-php-form-with-hidden-ip-and-date-please-help-me/ Share on other sites More sharing options...
chronister Posted December 8, 2008 Share Posted December 8, 2008 <?php $ipAddress = $_SERVER['REMOTE_ADDR']; $date = date('m/d/y', time()); ?> <input type="hidden" name="IP" value="<?php echo $ipAddress; ?>" /> <input type="hidden" name="Date" value="<?php echo $date; ?>" /><div id="container"> The date will be in m/d/y format, but if you want other formats, see the date() function on php.net Nate Link to comment https://forums.phpfreaks.com/topic/136027-php-form-with-hidden-ip-and-date-please-help-me/#findComment-709251 Share on other sites More sharing options...
ankur0101 Posted December 8, 2008 Author Share Posted December 8, 2008 Thank you sir Link to comment https://forums.phpfreaks.com/topic/136027-php-form-with-hidden-ip-and-date-please-help-me/#findComment-709330 Share on other sites More sharing options...
redarrow Posted December 8, 2008 Share Posted December 8, 2008 date_default_timezone_set('America/Los_Angeles'); << time() is not a php function to relie on except when set with this function.. you need to add your correct country settings for that function or it will give wrong time/date.. http://uk3.php.net/date_default_timezone_set Link to comment https://forums.phpfreaks.com/topic/136027-php-form-with-hidden-ip-and-date-please-help-me/#findComment-709334 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.