Computer NetworksNETWORKS PHP: Simple visitor counter by IP address January 2, 2024 Alice AUSTIN PHP: Simple visitor counter by IP address source ip address
if i use the real web server with this code, will they update the database? or the database only for the localhost?
Hi bro…I want to Post articles to Facebook from my website using PHP and MySQL ….plz can u help me ?…
Hi bro…I want to Post articles to Facebook from my website using PHP and MySQL ….plz can u help me ?…
Showing me This Error:Parse error: syntax error, unexpected 'ip' (T_STRING) in C:wamp64wwwtestindex.php on line 18 * Code I Use Same 1 <?php 2 // connection with database 3 $host='localhost'; 4 $user='root'; 5 $pass=''; 6 $db='test'; 7 try{ 8 $DBH=new pdo("mysql:host=$host;dbname=$db",$user,$pass); 9 }catch(PDOException $e){ echo"Not connected..".$e->getMessage(); 10 } 11 // Get Ip 12 $ip = $_SERVER['REMOTE_ADDR']; 13 // Check if this ip exist in out data 14 $sql="SELECT ip FROM visitors WHERE ip=$ip"; 15 $check=$DBH->prepare($sql); 16 $check->execute(); 17 $checkIp=$check->rowCount(); 18 if($checkIp==0) { 19 $query="INSERT INTO visitors(id,ip) VALUES(NULL,'$ip')"; 20 $inserIp=$DBH->prepare($query); 21 $insertIp->execute(); 22 } 23 $number=$DBH->prepare("SELECT ip FROM visitors"); 24 $number->execute(); 25 $visitor=$number->rowCount(); 26 echo $visitor; 27?>
Hi, I write the code like in the video but the result is zero.Why? How to make it functional?Thank you
its Unique Visitor County without any timeline (life time). its don't count how many visit happen by per IP.
my value shows 0 only ..not start from 1,, even no increment there
Nice video. Can you include the source code?
if i use the real web server with this code, will they update the database? or the database only for the localhost?
Here's the code guys: https://urlshort.host/PhpVisitorCounterCode you're welcome 🙂
Hi bro…I want to Post articles to Facebook from my website using PHP and MySQL ….plz can u help me ?…
Hi bro…I want to Post articles to Facebook from my website using PHP and MySQL ….plz can u help me ?…
Sir,
How To Show an wifi IP Address of Remote Computer / Browser / mobile
Sir, is it possible to show IP on the visitor's site?
I mean, user can see the own IP.
Showing me This Error:
Parse error: syntax error, unexpected 'ip' (T_STRING) in C:wamp64wwwtestindex.php on line 18
* Code I Use Same
1 <?php
2 // connection with database
3 $host='localhost';
4 $user='root';
5 $pass='';
6 $db='test';
7 try{
8 $DBH=new pdo("mysql:host=$host;dbname=$db",$user,$pass);
9 }catch(PDOException $e){
echo"Not connected..".$e->getMessage();
10 }
11 // Get Ip
12 $ip = $_SERVER['REMOTE_ADDR'];
13 // Check if this ip exist in out data
14 $sql="SELECT ip FROM visitors WHERE ip=$ip";
15 $check=$DBH->prepare($sql);
16 $check->execute();
17 $checkIp=$check->rowCount();
18 if($checkIp==0) {
19 $query="INSERT INTO visitors(id,ip) VALUES(NULL,'$ip')";
20 $inserIp=$DBH->prepare($query);
21 $insertIp->execute();
22 }
23 $number=$DBH->prepare("SELECT ip FROM visitors");
24 $number->execute();
25 $visitor=$number->rowCount();
26 echo $visitor;
27?>
How to show country name.
Its Working. Thank You Sir !!
Cpenal
I should require implementing this coding in website online
Plz sir reply sir
How implement online sir this coding
Salam g
Hi, I write the code like in the video but the result is zero.Why? How to make it functional?Thank you
strange coding what is it?
bro i says views: 0
Where i can copy this code?
Where i can copypaste this?
its Unique Visitor County without any timeline (life time).
its don't count how many visit happen by per IP.
how to get latitude and longitude with visitor guys ?
please help me 🙂