PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
t_henson
Regular
Regular


Joined: Feb 02, 2007
Posts: 65
Location: Cincinnati, Ohio

PostPosted: Fri Feb 02, 2007 3:22 am Reply with quote Back to top

hi, im looking for information on retrieving some visitor info that i can put into a phpnuke block. i want to get the ip, isp, and the browser. i am currently using these 3 functions:

$browser = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$isp = gethostbyaddr($_SERVER['REMOTE_ADDR']);

this works, and turns out like this (edited of course):

Your IP Address: xx.xx.xx.xx

Your Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9

Your ISP: cpe-xx-xx-xx-xx.cinci.res.rr.com

but its not exactly what im looking for. im lookin for something like this:

Your IP Address xx.xx.xx.xx

Your Browser Firefox

Your ISP: Road Runner

is there a way of doing this?
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Fri Feb 02, 2007 10:47 am Reply with quote Back to top

Well for the browser, you can use the code like used for the Statistics module to determine what they are using. See includes/counter.php

For the ISP, there isn't a set standard. Esp since there are many many ISPs, it would be really hard to implement in code. You'd really have to get a list of every ISP
View user's profile Send private message Visit poster's website
t_henson
Regular
Regular


Joined: Feb 02, 2007
Posts: 65
Location: Cincinnati, Ohio

PostPosted: Fri Feb 02, 2007 12:48 pm Reply with quote Back to top

well that worked, thanks.

what im essentially trying to achieve is the same style of info similiar to this image. i just want it to be text instead of an image obviously.

Image
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Fri Feb 02, 2007 3:20 pm Reply with quote Back to top

i think i have this one right...
put together,works for me....

Code:

<?
// add new browsers in lower case here, separated
// by spaces -  order is important: from left to
// right browser family becomes more precise
$browsers = "mozilla msie gecko firefox ";
$browsers.= "konqueror safari netscape navigator ";
$browsers.= "opera mosaic lynx amaya omniweb";
$browsers = split(" ", $browsers);
$nua = strToLower( $_SERVER['HTTP_USER_AGENT']);
$l = strlen($nua);
for ($i=0; $i<count($browsers); $i++){
$browser = $browsers[$i];
$n = stristr($nua, $browser);
if(strlen($n)>0){
$GLOBALS["ver"] = "";
$GLOBALS["nav"] = $browser;
$j=strpos($nua, $GLOBALS["nav"])+$n+strlen($GLOBALS["nav"])+1;
for (; $j<=$l; $j++){
$s = substr ($nua, $j, 1);
if(is_numeric($GLOBALS["ver"].$s) )
$GLOBALS["ver"] .= $s;
else
break;
}
}
}
echo("<pre>Your browser: ");
echo($GLOBALS["nav"] . " " . $GLOBALS["ver"] . "</pre>");
$agent = getenv("http_user_agent");
$ip = $_SERVER['REMOTE_ADDR'];
$fullhost = gethostbyaddr($ip);
$host = preg_replace('/^[^.]+./', '*.', $fullhost);
?>
IP address <?=$ip?><br />
Host: <?=$host?>
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum