Pages

Tuesday, February 21, 2012

MAKING VISITORS INFO PAGE PHP

VISITORS INFO PAGE

Visitor information page page was created in order to find out some information about website visitors, such as IP are used, browser used, and the date and time a user to browse your website.

To make the visitor info page, follow these steps:

1 Create a new page with HTML, then save it as visitors_info.php.
2 Next create another new page with the PHP option, enter the following script:

$time = date("d F Y, h:iA");
$ip = $REMOTE_ADDR; 
$browser = $HTTP_USER_AGENT; 
$fp = fopen("visitors_info.html", "a"); 
fputs($fp,"
Address IP:$ip Time: $time
Browser: $browser

"); 
fclose($fp); 
?>


$ REMOTE_ADDR function is used to obtain the IP numbers of visitors, the function date () to take the time, while the function $ HTTP_USER_AGENT is used to obtain information on what browser you are using and its version of the browser.
visitors_info.html used to open the file open function (), then the information is already in use can be written in visitors_info.html function fputs (). File visitors_info.html closed using the function fclose ().

3. Save and name it as visitors_info.php.
4. Show to your browser to see results...

Source from  toscripts.com/subtutor/visitors-info-page.html