getting ip
Posted: Thu Jan 30, 2003 5:59 am
Hi Guys,
Please can anyone tell me why this snippet
is not doing what is expected.
The code could store only the date but not
IP address.
Please why??
Can anyone help me??
Thanks in advanced
Please can anyone tell me why this snippet
is not doing what is expected.
The code could store only the date but not
IP address.
Please why??
Can anyone help me??
Thanks in advanced
Code: Select all
<?php
$ip_address = $REMOTE_ADDR;
$the_date = date("Y-m-d");
$conn = @mysql_connect("localhost","username","password") or die("cannot connect to MySQL");
@mysql_select_db("ipvisits") or die("cannot connect to the database");
@mysql_query("INSERT INTO visitorsips(ip,date) VALUES ('$ip_address','$the_date')");
mysql_close($conn);
?>