IconIcon

Tuesday 13 May 2014

How to detect visitor's IP on your website?

Welcome to techntips.net
Recently we published How to Create Autoclick Link and banners in HTML

Today I am going to share, How to detect visitor's IP on your website .


techntips.net

Step1:-- Open any text editor, like - notepad and paste below code in your text editor.

            CODE:-----

                               <?php
                              $ip=$_SERVER['REMOTE_ADDR'];
                              echo "Your ip address -  $ip"; 
                              ?> 
 Now save this file as- .php   example-  webpage.php

 Step2:-- Now upload php file to your webhosting service like- 000webhost.com
        When someone will visit your php webpage visitor can see
         his IP has been tracked.

You can use PHP include function to import your html webpage in PHP that will make it easier for you to track visitor's IP on your html based website.

Example- Suppose I have a html webpage and html file name is-
                 index.html
                 To import our index.html in PHP webpage we will use:-
                  include "index.html";
                 Above code will import index.html in PHP webpage.
                 In this way we can track visitor's Ip on html webpage.

SUBSCRIBE US TO GET UPDATES FOR FREE 

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...