SonniE
04-08-2008, 03:26 PM
All Written By Me you will need to make this a php document and then create a file on the same directory called iplogsource.txt
Wana Test it?
whatsmyip.php (http://www.codinghs.com/forums/codinghsexclusivelink/whatsmyip.php)
and the log is
iplogsource.txt (http://www.codinghs.com/forums/codinghsexclusivelink/iplogsource.txt)
<html>
<body bgcolor="red">
<?php
echo "Your iP iS: ";
echo $_SERVER['REMOTE_ADDR'];
$ip = $_SERVER['REMOTE_ADDR'];
$myFile = "iplogsource.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "------------------------------------------";
fwrite($fh, $stringData);
$time = date("r");
fwrite($fh, $time);
$Space = "\n";
fwrite($fh, $Space);
$stringData = $ip;
fwrite($fh, $ip);
$stringData = "\n";
fwrite($fh, $stringData);
$stringData = "\n";
fwrite($fh, $stringData);
fclose($fh);
?>
</html>
Wana Test it?
whatsmyip.php (http://www.codinghs.com/forums/codinghsexclusivelink/whatsmyip.php)
and the log is
iplogsource.txt (http://www.codinghs.com/forums/codinghsexclusivelink/iplogsource.txt)
<html>
<body bgcolor="red">
<?php
echo "Your iP iS: ";
echo $_SERVER['REMOTE_ADDR'];
$ip = $_SERVER['REMOTE_ADDR'];
$myFile = "iplogsource.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "------------------------------------------";
fwrite($fh, $stringData);
$time = date("r");
fwrite($fh, $time);
$Space = "\n";
fwrite($fh, $Space);
$stringData = $ip;
fwrite($fh, $ip);
$stringData = "\n";
fwrite($fh, $stringData);
$stringData = "\n";
fwrite($fh, $stringData);
fclose($fh);
?>
</html>