I need to get the IP Address of my visitors and write it to a database or file. Can anyone give me an example???
IP Address
Started by
Guest_NeedHelp_*
, May 02 2006 04:29 PM
3 replies to this topic
#1
Guest_NeedHelp_*
Posted 02 May 2006 - 04:29 PM
Guest_NeedHelp_*
|
|
|
#2
Posted 02 May 2006 - 04:35 PM
<?php $file = "iplog.txt"; $fp = fopen($file, "a+"); fwrite($fp, $_SERVER["REMOTE_ADDR"] ."\n"); fclose($fp); ?>
#3
Posted 03 May 2006 - 07:45 AM
RobSoftware said:
<?php $file = "iplog.txt"; $fp = fopen($file, "a+"); fwrite($fp, $_SERVER["REMOTE_ADDR"] ."\n"); fclose($fp); ?>
Do you have any idea how to write to a mysql database, i would like to know how that works.
#4
Posted 03 May 2006 - 09:13 AM
Ronin said:
Do you have any idea how to write to a mysql database, i would like to know how that works.
After you've connected to the database you could do:
$query = "INSERT INTO tbl_name VALUES ($_SERVER["REMOTE_ADDR"] )"; mysql_query($query);


Sign In
Create Account

Back to top










