Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Chicago, IL

    PHP Script does not work after upgrade to PHP5. HELP!

    I'm trying to make my site work again like it did before. Basically the index page would use the include function to add content so instead of editing each page when a link change occurred I would just edit the index.php file. Unfortunetly after turning register_globals=off for security reasons and upgrading to php5 (I can't tell what the reason is) my code is not working anymore.

    $default = "welcome";
    if($page == ""){$page = $default;} 
    I have no idea why this is not working anymore as it shouldn't affect the site.

    The current effect is that it is loading the main site if I click on any of the tutorial links instead of loading the content in the middle (The site can be seen at: Thanks for your help!
    Last edited by Senad; 12-26-2006 at 09:41 AM.
    PingPros LLC | International Network Consultant & Internet Service Provider
    Cisco, Juniper, Extreme, BGP, OSPF, Windows, Linux, and Mac Consulting services | Internet Service Provider
    High Quality Services at a very competitive price!

  2. #2
    Join Date
    Dec 2005
    1,337 is loading fine and I am able to visit the other pages of the website. Can you please tell us how to duplicate the issue?

  3. #3
    Join Date
    Sep 2004
    Does this work?
    PHP Code:
    include ("./" . ($page==""?$default:$page) . ".php"); 

  4. #4
    Join Date
    Mar 2004
    the problem is your script works if register global is on

    if($page == "") <-- this is the problem

    it should be $_GET['page'] if this is a get method, or $_POST['page'] for post.

Posting Permissions

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