SitePoint Sponsor

User Tag List

Results 1 to 25 of 25
  1. #1
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Problems with php includes but only in IE ?!

    Hi,

    I have a website where some of the pages get build with includes but the pages with the includes don't render when you request them until you press F5.
    It has to be an include problem cause the other noniclude-php pages work fine. This website and these pages worked perfect on my local system, apache on win Xp. The strange thing is that this "bug" only occurs in IE and not in firefox ... how can the type of browser have any effect on includes and how do I fix this ?

    Thanks in advance.


  2. #2
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ive heard this somewhere before i think, what method are you using to include the files!?

  3. #3
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    index.php is located in the rootfolder and calls header.php like this

    PHP Code:
    <?php
        
    include 'includes/header.php';
    ?>


  4. #4
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I heard before that it can sometimes cause problems depending how you include.

    Have you tried

    PHP Code:

    include ('file.php'); 
    or

    PHP Code:

    include("file.php"); 

  5. #5
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I tried your suggestions but the problem remains ...


  6. #6
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you got a url so i can see!??

  7. #7
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The browser makes no difference. Includes are server side so they do not depend on the browser. Clear your cache (Temporary Internet Files) and try again.

  8. #8
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I know server side includes don't care what browser you use but I can assure you the problem is non-existant in Firefox.


  9. #9
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    the page can be found at www.kewan.be/index.php (edit), clicking "welkom" a couple of times ( in IE ) should show what I mean.

    edit: make sure to add the extension cause I've added a temp index.html
    Last edited by Percept; Oct 9, 2004 at 12:38.


  10. #10
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I jsut tried the link in IE and Firefox and it works the same in both of them!? seems to work ok for me!

    It dont like you! :P

  11. #11
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mark_W
    I jsut tried the link in IE and Firefox and it works the same in both of them!? seems to work ok for me!

    It dont like you! :P
    Did you click the first navigation link "Welkom" a couple of times ?


  12. #12
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, it just worked fine!

  13. #13
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is weird. It happened to me on welkom, multimedia and contact...

  14. #14
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought you were going to say it worked Twig and maybe there was some sort of cache problem at percepts end!!! This is pretty weird! I just tried again and its fine.

  15. #15
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Young Twig
    That is weird. It happened to me on welkom, multimedia and contact...
    Yup, those are all the pages which have includes ... I also have includes in the includes but they've told me that shouldn't be a prob.


  16. #16
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    When I think about it ... contact.php does not have any includes ... the only thing these pages have in common is the fact they al have:

    PHP Code:
    <?php
        session_start
    ();
    ?>
    on the first line. Could sessions be causing this then ?


  17. #17
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm... it could very well be something clearing out your session files in /tmp (or wherever your sessions are stored). Try taking out the session-specific stuff and see. You may have to create your own directory to store session files if you're on a shared webhost. That's what I had to do last time when the /tmp folder seems to get cleansed everytime and I started losing my sessions. But weird that it happens only in IE, so maybe this isn't it.

  18. #18
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I created a sessiontmp dir on the webspace but the result stays the same ... this is not the host I usually use so I might convince the guy from switching cause it works on my other webspace.


  19. #19
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's weird. I go to it, it shows blank, I refresh, it works.

    Are you sending any headers? Cache headers maybe?

  20. #20
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ok, it's getting worse ... now it gives the same result on my own webspace. I'm not using any caching headers or anything. I've really no idea what could be causing this.


  21. #21
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sessions are a type of header, that's the only thing I can think of.

  22. #22
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by someonewhois
    Sessions are a type of header, that's the only thing I can think of.
    Here's the code for the contact page at http://www.kewan.be/contact.txt and the included header.php can be found at http://www.kewan.be/includes/header.txt

    I don't think I'm doing anything out of the ordinary here, am I ?
    Last edited by Percept; Oct 10, 2004 at 12:12.


  23. #23
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shouldn't
    PHP Code:
    session_save_path(sessiontmp); 
    be
    PHP Code:
    session_save_path('sessiontmp'); 
    ?

  24. #24
    Romans 12:2 codyrockx's Avatar
    Join Date
    Jul 2003
    Location
    Newberg, Oregon
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    regardless, php will assume that you made a mistake and parse it as the correct way, 'sessiontemp'. although it does seem to be your sessions that are messed up, or it may be any number of things. this happens to me when i have loops that just crash the page and won't load. it may be the same with your page that when you are trying to load the session file from the user, it cannot find it. you could check that it is that by removing all the lines that have to do with the session, if it loads after taking that out with no problems then you've found it. it's just somewhere in there. take it apart and go from there.
    Codyrobert.com - Designer and Developer

  25. #25
    webdesign Percept's Avatar
    Join Date
    Jan 2003
    Location
    Belgium
    Posts
    397
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I've found the solution on IRC ... the problem was solved by adding

    header("Cache-control: private");

    after

    session_start();

    Thanks for the help everyone !



Bookmarks

Posting Permissions

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