PHP System Info. Display

For any computer related topics such as hardware, operating systems, computer problems and the like.

Moderators: HeRetiK, The inner Core

User avatar
Palmer
damaged
damaged
Posts: 116
Joined: Wed Oct 29, 2008 12:08 am
Location: Underground...
Contact:

PHP System Info. Display

Postby Palmer » Thu Feb 17, 2011 4:30 am

I'm sure some of the non-techies might get a little scare out of it, seeing their info. actually showing on the page... You'd be surprised but it works some times.
For example:
http://tinyurl.com/kiddy-sex-site
(No, it doesn't actually have porn or anything bad on it, FYI)

I post this in anonymous chat boards from time-to-time on pages I go to. ;D

focusing on the PHP:

Code: Select all

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$hostaddress = gethostbyaddr($ip);
$browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER']; // a spelling mistake that stuck in php

print "<strong>Display IP address:</strong><br />";
print "$ip<br /><br />";
print "<strong>More detailed host address:</strong><br />";
print "$hostaddress<br /><br />";
print "<strong>Display browser info</strong>:<br />";
print "$browser<br /><br />";
print "<strong>Where you came from>:<br />";
if ($referred == "") {
print "Page was directly requested";
}
else {
print "$referred";
}
?>
Image

Return to “Computers”

Who is online

Users browsing this forum: No registered users and 1 guest