learn with riwash
How can i store, collect client ips in website using php,sql?
Hello friends in this artical i am going to teach how you
can store or collect client ips in your website or database.
In here we use php script just fellow the steps.
collec
<?
//we have a variable $ip_found that collect client ips
//this is for client server ips
if(!empty($_SERVER["HTTP_CLIENT_IP"]))
{
$ip_found = $_SERVER["HTTP_CLIENT_IP""];
}
//this is for client proxy ips
else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
{
$ip_found = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
else{
$ip_found = $_SERVER["REMOTE_ADDR"];
}
?>
here in varible that store or collect ips of client now if you want to get oup put
ips in client then write
<?php
//output of ips
echo $ip_found;
?>
this is a way you can collect ips of client.

No comments:
Post a Comment