A little PHP question

shanes

New Member
Messages
35
Reaction score
0
Points
0
Well i'm a total 'newbie' when it comes to PHP , I know close to nothing , anyway I recently downloaded a CMS and I was looking through the source and I found this , i'm wondering what this code does as it seems dodgy , to me it looks like the site is logging the information I enter into my mysql database and sending it off to a 3rd party site , I just want someone to confirm it.
Here's the code:
PHP:
$domain = $_SERVER['HTTP_HOST'];
$ip = $_SERVER['REMOTE_ADDR'];
$report = file_get_contents("*Removed*/logger/installs.php?d=".$domain."&i=".$ip."");

It probably isn't anything bad but better safe than sorry :lockd:
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
1. What is the CMS?

2. What is the name of the file?

3. I think it is logging your info like time and date into your mysql database, joomla does that.
 

shanes

New Member
Messages
35
Reaction score
0
Points
0
1. What is the CMS?

2. What is the name of the file?

3. I think it is logging your info like time and date into your mysql database, joomla does that.

1. You woun't know the CMS as it's a made by a user on a forum I go on , it's called HSP (Habbo site panel)

2. Ermm can't remember , it's a config file that you go on to create a username for the CMS

3 Probably is , wasn't too sure so i asked , I'm guessing it's a way of checking who uses their panel
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Looks like it is logging your site's domain and your IP address to some remote site. What is the *Removed*? What was there? Was it a URL? That is what it looks like
 

shanes

New Member
Messages
35
Reaction score
0
Points
0
I removed the domain manually lol I only removed the domain name , the extension of the url is still there.

Thanks for your help , I'm guessing that's their way of tracking sites , I still think it's kinda dodgy though :(
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Heh, I have similar code in a number of free scripts I've released over the years, its nice to know who's using 'em.
 

Thewinator

New Member
Messages
256
Reaction score
0
Points
0
PHP:
$domain = $_SERVER['HTTP_HOST'];
Gets the domain the file is running from.
PHP:
$ip = $_SERVER['REMOTE_ADDR'];
Gets the ip address of the visitor of your site.
PHP:
$report = file_get_contents("*Removed*/logger/installs.php?d=".$domain."&i=".$ip."");
Is actualy a bit of a useless line unless the $report is actualy echo'ed later.
But basicly it loads the response of /logger/installs.php to the domain and ip sent to it.
If you want to find out what that file does with that data then you should open it (if you have access to it), and look for
PHP:
$_GET['d']
and
PHP:
$_GET['i']
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Its not quite useless, it sends the domain and the IP to installs.php via GET.

They do the processing from there. The file itself probably outputs nothing at all.
 

Thewinator

New Member
Messages
256
Reaction score
0
Points
0
I was refering to the designating it to the variable.
just the file_get_contents command would suffice to send information using the get method. ;)
And like you said it probebly outputs nothing, so it no use to store that nothing.
 
Last edited:
Top