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
    Sep 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy PHP Problem Please Help!

    I'm having a strange problem with the site im trying to build. its basically a template index page consisting of nav, graphic, poll etc which calls includes into its main area that make up the body of the page you want to view. i.e index.php?pageid=news for the news page etc. these files are stored in a sub directory called /pages. the index page checks that the file exists in the dir if not bounces you to the news page, fairly straight forward so far?

    example links:

    http://www.insecureinc.com/index.php?pageid=adminarea (takes you to the admin area login screen)

    http://www.insecureinc.com/index.php?pageid=fakepage (bounces you to news - feel free to try another word)

    this is where my problem becomes a little more bizzare, when you click this link you will see why..
    http://www.insecureinc.com/index.php?pageid=admin

    it doesnt bounce you to the news page it just displays a blank the weird thing is though i was using pageid=admin originally before it mysteriously stopped working so i changed my code references to adminarea and like magic, started working again. heres my code..

    on page load:
    PHP Code:
    //CHECK TITLE
    $check_title "./pages/".$pageid.".inc";
    if (
    file_exists($check_title)) {
        
    $title $pageid;
        } else if(
    $pageid == "adminarea") {
        
    $title "admin";
        } else {
        
    $title "news";

    in the page "content section":
    PHP Code:
    <?
    $check_files 
    "./pages/".$pageid.".inc";
    if (
    file_exists($check_files)) {
        include(
    "./pages/".$_GET[pageid].".inc");
        } else if(
    $pageid == "adminarea") { include("./admin/admin.inc");
        } else {
        include(
    "./pages/news.inc");
    }
    ?>
    I'm using a seperate exception for the admin bit to mask the URL for anyone who might guess. I basically cant understand why the old "admin" id is still showing up, or why it stopped accepting the includes in the first place, could an external file be causing this? please help!

    P.S. I dont want to use the switch statement thats not the issue here.
    Last edited by U'ziel; 09-20-2005 at 08:38 PM.

  • #2
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *bump*

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I don't understand, it appears to be working correctly for me. Is it possible you were running a cached version of the page?
    Pageid = admin takes me to news, pageid = adminarea takes me to login. Thats how you need it correct?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

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