www.webdeveloper.com
Results 1 to 5 of 5

Thread: PHP Include script works on remote server but not when file is on same server

  1. #1
    Join Date
    Mar 2006
    Location
    London
    Posts
    155

    PHP Include script works on remote server but not when file is on same server

    PHP Code:
    <?php

    $game 
    $_GET['game'];
    $page $_GET['page'];
    $letter $_GET['letter'];
    $console $_GET['console'];

    if(!
    $console && !$letter && !$game && !$page) { //checks whether or not the vars are empty
    include "http://www.gameslayer.co.uk/cheatserve/serve/default.php?type=title"//if either is emtpy (or both) then include the default file
    } else {
    include 
    "http://www.gameslayer.co.uk/cheatserve/serve/" $console .  $letter .  $game .  $page ".php?type=title"//otherwise include id.php so if id=1234 then 1234.php


    ?>
    The above code i am using works on a remote server
    (http://cheatserve.100webspace.net/)

    But not on my server
    (http://www.gameslayer.co.uk/mobile/cheats/)

    I thought it may have been the absolute link in include but have changed it and it still doesn't work.
    Last edited by danpoulton; 01-29-2008 at 10:59 AM.

  2. #2
    Join Date
    Mar 2007
    Location
    Orlando
    Posts
    670
    make sure your include statement has the correct path. Use $_SERVER['DOCUMENT_ROOT']

  3. #3
    Join Date
    Mar 2006
    Location
    London
    Posts
    155
    i have the correct document root, but it does not work still, any ideas why?

  4. #4
    Join Date
    Mar 2007
    Location
    Orlando
    Posts
    670
    Can you show your code that doesn't work?

  5. #5
    Join Date
    May 2004
    Location
    FL
    Posts
    3,447
    Be sure you have the right path listed in "include_path" in your php.ini file. I have gotten tripped up on that before.
    Lee

    ""Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."" -- Sir Winston Churchill

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles