#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    REQUEST_URI not working on live server


    So I'm trying to get PHP to include certain code if the page is index.php, and although this works for me under MAMP, uploading the file onto the live server results in the code never being displayed.

    I'm thinking they don't support the REQUEST_URI function, but I'm not sure and don't know what to replace it with.

    What would be the most effective way of getting the file to display only on index.php?

    PHP Code:
    <?php
            
    if ($_SERVER["REQUEST_URI"] == "/index.php") {
    include(
    'scrollbanner.php');
    }
    ?>
  2. #2
  3. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,660
    Rep Power
    4123
    debug!!!!!

    PHP Code:
    print_r($_SERVER); 
    what can you see?
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    I see this


    Hehe, thanks. Because of the debug I replaced REQUEST_URI with SCRIPT_NAME and now all is excellent.

    Thank you!

IMN logo majestic logo threadwatch logo seochat tools logo