Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website Design Forum


You are currently viewing our Website Design Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
[PHP] How to check ip, host and browser?
Old 02-16-2006, 04:33 AM [PHP] How to check ip, host and browser?
Junior Talker

Posts: 33
Trades: 0
This is basic code to check ip, host and browser.

If you wanna to check ip, you can use global variable:
Code:
$_SERVER["REMOTE_ADDR"];
To check host, you can use also global variable:
Code:
$host=gethostbyaddr($ip)
And at the end to check browser:
Code:
$_SERVER["HTTP_USER_AGENT"];
If we integrate this variables we can create code like this:
Code:
<?php
$ip=$_SERVER["REMOTE_ADDR"];
$host=gethostbyaddr($ip);
$browser=$_SERVER["HTTP_USER_AGENT"];

echo '<center>


<span>Your IP:';
echo $ip;
echo '
Your host:';
echo $host;
echo '
Your browser:';
echo $browser;
echo '</span></center>';
?>
First three lines declarate new variables: ip, host, browser. Rest - echo code show result on the screen.

Created by m1chu
m1chu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-16-2006, 10:34 AM
Junior Talker

Posts: 76
Trades: 0
Nice, I might use that on my site
IndianInk is offline
Reply With Quote
View Public Profile Visit IndianInk's homepage!
 
Old 02-16-2006, 09:02 PM
Super Talker

Posts: 132
Trades: 0
thanx i will also try to use it on my own site
__________________
Looking For Mods n Members


Please login or register to view this content. Registration is FREE
waqar is offline
Reply With Quote
View Public Profile
 
Old 02-16-2006, 09:19 PM
Junior Talker

Posts: 190
Trades: 0
Cool Tutorial!
alvarezw is offline
Reply With Quote
View Public Profile Visit alvarezw's homepage!
 
Reply     « Reply to [PHP] How to check ip, host and browser?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13609 seconds with 12 queries