Online
 
Friday, 09 January 2009
 
 
More article:
Related Content:

Your Ad Here

PHP - Showing the Browser and IP Address
 

Showing the Browser and IP Address

Here is a simple page that prints out the browser string and the IP address of the HTTP request. Create a file with the following content in your web directory, name it something like example.php3, and load it in your browser:

<html><head><title>PHP Example</title></head>

<body>

You are using

<?php echo $_SERVER['HTTP_USER_AGENT'] ?>

<br />

and coming from

<?php echo $_SERVER['REMOTE_ADDR'] ?>

</body></html>

You should see something like the following in your browser window:

You are using Mozilla/5.0 (X11; U; Linux i686; en-US; 

rv:1.1b) Gecko/20020722

and coming from 127.0.0.1

 

Tags: Add more tags...,
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment. Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 4000
 Notify me of follow-up comments
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

Your Ad Here
Mobile Wallpaper 250
Statistic


Last Post

 
Top! Top!