Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    index.php?id= problem

    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 Code:
    <?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!
    Last edited by gentleone; 03-19-2009 at 10:12 AM. Reason: PHP versions

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    It sounds like your client's server has register_globals disabled so what you have won't work. This probably will though.
    PHP Code:
    <?php    $id htmlentities($_GET['id']); $found FALSE;    if(file_exists("$id.php")) {include("$id.php");    $found TRUE;}    if(!$found) {include("about.php");}?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    gentleone (03-19-2009)

  • #3
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Aerospace Eng... BULLS EYE!!!!

    Thanks alot for solving this problem!

    Gentle Greetz,
    Ralph


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •