Php Includes Help

Discussion in 'PHP' started by WebDivx, May 19, 2007.

  1. #1
    I just switched hosts and my site has totally gotten messed up.

    I have one of those urls that go like this my http://mysite.com/?file=MyFile
    Ok, so you go to my site, mysite.com and the php calls mainpage.html. Everything looks fine and dandy. BUT when I go to another page, say Page 2 (http://mysite.com/?file=Page2) the same content from my main page comes up as opposed to the Page 2 stuff. It use to work find on my old host, but not with my new host Godaddy. Here is the code I use to use

    <?php
    $page = $HTTP_GET_VARS['file'];
    $extension = "txt";
    if ( !$page || $page == "" )
    { include "/my/path/mainpage.html"; }
    else ( file_exists( "/my/path/$page.$extension" ) )
    ?>

    How can I fix this? Does anybody have another code that is Godaddy compatible? Help is much appreciated!
     
    WebDivx, May 19, 2007 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    TwistMyArm, May 19, 2007 IP