How can i store, collect client ips in website using php,sql? - Learn With Riwash

Breaking

Learn With Riwash

learn with riwash learn with riwash is the personal blog/youtube channel that provide best knowledge of software development. Here we give complate trainning of techonology as will as build software. We teach you related to web developing and programming in html,javascript,php,python,c++, c#, java programming ect. It is not a complate teaching siti like W3schools but it it a blog where we give code that help you to become better programmer.

ads

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Tuesday, March 13, 2018

How can i store, collect client ips in website using php,sql?


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 Top Ad

Responsive Ads Here