Visitor Counter with cookies in PHP

Here we are describing how we can check visitor in a website with he help of Cookies in PHP.
We will setup a cookies in the user Browser for one year.

So we will first check about that particular cookies present in User's Browser. If the cookies is present in the User's Browser (Client Computer) , we have to do nothing on that condition, as the user is old for the that website.

If the cookies is not present in the user's Browser, we will setup the cookies in the user's Browser and update the details on the database for total count for that website, we are using the visitor counter.

So the first condition to check we have is:

is the cookies is present in the Browser:
 For this we have the function on php, which is isset(),  This function is used for checking the variable is set in the Program or not.   The cookies, we will create with the name of "isvisitor"
So the code will be as follow:
<?php
if(isset($_COOKIES))
?>



Comments

Popular posts from this blog

Page Unload Show Notification to user

Function Oriented File Upload PHP

Upload File Using PHP - Example For Image