Php

Talk about anything to do with making sites or running Servers.
Post Reply
Char
noob
Posts: 28
Joined: Fri Jul 22, 2005 7:54 pm

Post by Char »

i am learning php
i have a problem...well how can i save people's IP adress?
i put this to my site and then it will print he's ip when he goes to my homepage

Code: Select all

<?php
echo &#036;_SERVER&#91;"REMOTE_ADDR"&#93;;
?>
i basicly want that it would write people's ip to a text file who have had visited my homepage :)
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

<?
&#036;log_file = "log.txt";
&#036;ip = &#036;REMOTE_ADDR;
&#036;page = &#036;_SERVER['REQUEST_URI'];
&#036;host = gethostbyaddr(&#036;REMOTE_ADDR);
&#036;date_time = date('d-m-Y/H:i:s');
&#036;fp = fopen("&#036;log_file", "a");
fputs (&#036;fp,"
(&#036;date_time) &#036;ip (&#036;host) &#036;page
");
flock(&#036;fp, 3);
fclose(&#036;fp);
?>


THERE YOU GO SOUDL WORK FINE
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Post Reply