Jump to content

PHP form with hidden IP and Date, please help me ....


ankur0101

Recommended Posts

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 ...

<?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

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

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.