Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] IP Displayer

Banned
Banned
Joined
Jun 24, 2008
Messages
723
Reaction score
1
Hey, I noticed Superfun's signature the other day.

It has something like:

Code:
Superfun Randomizer: lulz

Hello _IP_

Well, I made a quick script which shows your IP ( ), how can I make it so it will enable me to have something like Superfun's signature?

Where it will show the IP?
 
duck you, I'm a dragon
Loyal Member
Joined
Apr 29, 2005
Messages
6,407
Reaction score
130
Write it on an image.



A little example:

PHP:
<?php
$img = imagecreate(250, 250); //Image dimensions
$bg = imagecolorallocate($img, 255,255,255); //White background
$txtcolor = imagecolorallocate($img, 0, 0, 0); //Black textcolor. 

imagestring($img, 1, 50, 50, $_SERVER['REMOTE_ADDR'], $txtcolor); //Write IP to image

header('Content-type: image/gif');

imagegif($img);
imagedestroy($img);
?>
 
Joined
Dec 26, 2006
Messages
1,305
Reaction score
167
Monsta. - [PHP] IP Displayer - RaGEZONE Forums

(ip like above post)

randomizer is just
PHP:
$random['1'] = "lol";
$random['2'] = "lul";
$random['3'] = "orly";
$random = $random[rand(1,3)];
for the browser and os just get it from the useragent.
ill post an array of os and browser in an min
edit:

this is what i got so far, ofcourse there are loads more out on the internet:
PHP:
        $Browsers = array
                (
                        'MSIE 5.5' => 'IE 5.5',
                        'MSIE 6.0' => 'IE 6.0',
                        'MSIE 7.0' => 'IE 7.0',
                        'Konqueror' => 'Konqueror',
                        'Netscape' => 'Netscape',
                        'MSIE' => 'IE',
                        'Firefox' => 'Firefox',
                        'Chrome' => 'Google Chrome',
                        'Safari' => 'Safari',
                        'Opera' => 'Opera',
                        'Netscape' => 'Netscape',
                        'Galeon' => 'Galeon',
                        'Konqueror' => 'Konqueror',
                        'Lynx' => 'Lynx',
                        'Googlebot' => 'Google Bot',
                        'perl' => 'Perl LWP',
                        'Nikto' => 'Nikto Webscanner',	
                        'Mozilla/4.8' => 'Netscape',
                        'Charlotte' => 'Charlotte Web search',
                        'Minefield' => 'Minefield',
                        'SeaMonkey' => 'SeaMonkey',
                        'PLAYSTATION 3' => 'Playstation 3',  
                        'GranParadiso' => 'Mozilla GranParadiso',  
						'HTTrack' => 'HTTrack web copyier',
						'K-Meleon' => 'K-Meleon',
                );

        $OperatingSystems = array
                (
						'Windows 98' => 'Windows 98',
                        'Win98' => 'Windows 98',
                        'Windows NT 5.0' => 'Windows 2000',
                        'Win95' => 'Windows 95',
                        'Windows NT 5.1' => 'Windows XP',
                        'Linux' => 'Linux',
                        'Windows NT 6.0' => 'Windows Vista',
                        'Windows NT 5.2' => 'Windows 2003 server',
                        'Windows NT' => 'Windows NT',
                        'Win 9x 4.90' => 'Windows ME',
                        'Win ME' => 'Windows ME',
                        'Win CE' => 'Windows CE',
                        'Ubuntu' => 'Ubuntu',
                        'FreeBSD' => 'Free BSD',
                        'Symbian' => 'Symbian',
                        'Mac OS X' => 'Mac OS X',
                        'Macintosh' => 'Macintosh',
                        'Linux' => 'Linux',
                        'Unix' => 'Unix',
                        'Mac' => 'MacOs',
                        'PPC' => 'MacOs',
                        'HP' => 'HP-UX',
                        'SunOS' => 'Sun Solaris',
                        'Wii' => 'Wii',
                        'Googlebot' => 'Google Bot',
                        'perl' => 'Perl LWP',
                        'Nikto' => 'Nikto Webscanner',
                        'Charlotte' => 'Charlotte Web search',
                        'PLAYSTATION 3' => 'Playstation 3',  
                );
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
If you wanna go further you can use GeoIP and add more location details based upon the ip, etc :)
 
Joined
Jun 8, 2007
Messages
1,985
Reaction score
490
I'm tired of seeing my IP everywhere..

lol

echo $_SERVER['REMOTE_ADDR']; // IP Address
echo $_SERVER['REMOTE_HOST']; // Host user is viewing u through
echo $_SERVER['REMOTE_PORT']; // Port user is using to view ur site

And for the browser:

 
Joined
Dec 26, 2006
Messages
1,305
Reaction score
167
I'm tired of seeing my IP everywhere..

lol

echo $_SERVER['REMOTE_ADDR']; // IP Address
echo $_SERVER['REMOTE_HOST']; // Host user is viewing u through
echo $_SERVER['REMOTE_PORT']; // Port user is using to view ur site

And for the browser:

Nice i dindnt knew about an get-browser function. :)
 
Banned
Banned
Joined
Jun 24, 2008
Messages
723
Reaction score
1
Thanks SF.

You've helped, but I don't know how to get it in the positions I want ^_^
 
Back
Top