...

View Full Version : index.php?id= problem



gentleone
03-19-2009, 08:28 AM
Hi,

I'm new to PHP, so I'm working on my first PHP site which uses the following code that I found on the Internet:


<?php $found = FALSE; if(file_exists("$id.php")) {include("$id.php"); $found = TRUE;} if(!$found) {include("about.php");}?>

The site works fine on my own web server, but on the client's server if I click on the page links it always includes the about.php file.

Can anyone please help me with this? Do I have to contact the client's web hosting company?

My own webserver (PHP Version 5.2.0-8+etch13):
http://www.gentlemedia.nl/sm/index.php

Client's server (PHP Version 5.1.6):
http://www.sublimemistresses.com/index.php

Could the different PHP versions causing this problem?

Thanks in advance!

_Aerospace_Eng_
03-19-2009, 10:11 AM
It sounds like your client's server has register_globals disabled so what you have won't work. This probably will though.

<?php $id = htmlentities($_GET['id']); $found = FALSE; if(file_exists("$id.php")) {include("$id.php"); $found = TRUE;} if(!$found) {include("about.php");}?>

gentleone
03-19-2009, 10:21 AM
Aerospace Eng... BULLS EYE!!!!

Thanks alot for solving this problem!

Gentle Greetz,
Ralph



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum