PDA

View Full Version : Displaying certain things in PHP



James!
02-04-2006, 05:53 PM
I need to display:

Peoples IP
Peoples Browser

Anybody know the PHP code for it?

Craig
02-04-2006, 05:58 PM
<?php echo $_SERVER["REMOTE_ADDR"]; ?>

Is the IP =]

Splinter
02-04-2006, 06:03 PM
and the browser is:


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

so together they would be..


<?php
echo "IP: ".$_SERVER['REMOTE_ADDR']."<br />
Browser: ".$_SERVER['HTTP_USER_AGENT']."";
?>

Mentor
02-04-2006, 06:04 PM
http://thybag.co.uk/index.php?p=Tutorials&ind=25
Has all that and more

althogh the bits u want are
<?php echo $_SERVER['REMOTE_ADDR']; ?>
IP
and
<?php echo get_browser('browser'); ?>
For browser name (without the exstra crap)
(phramiter name from memoery so may be wrong as php manual wont load

Splinter
02-04-2006, 06:05 PM
I forgot the other browser code :P it could also be done in basic javascript...

James!
02-04-2006, 06:08 PM
Thanking you all and rep when I can :)

Johno
06-04-2006, 09:16 AM
Yep, I needed this as well so thanks very much!

Want to hide these adverts? Register an account for free!