Results 1 to 9 of 9

Thread: How do I require a file once and if its loaded do not load it again

  1. #1
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do I require a file once and if its loaded do not load it again

    created a workaround. thanks
    Last edited by boycetown; 09-03-2009 at 07:01 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    When I click on 'Home' the page doesn't load and returns an error.
    - Josh

  3. #3
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, this is the error that occurs because it is trying to pull in the home page again which contains that analytics-include at the bottom. I am assuming it is because the analytics page is already there, loading it again is the issue. This is what I am trying to avoid is having it load that particular include at the bottom again since it has already been brought in. Take a look at the source code the instant you come across the home page.

  4. #4
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    It's a very nice site btw but you may wanna give the boy on the home page pupils in his eyes, it kinda creeps me out
    - Josh

  5. #5
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    haha, yes, no pupils are pretty scary. thanks for the compliment on the site. so any ideas on how to avoid having that section load in again? do you see what I mean w/ the include? the pages fade in and fade out of the web browser so the source code doesn't change since the page doesn't actually reload.

  6. #6
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    No, sorry, I'm not getting any blank pages, and I've clicked the About link and then clicked to go Home and everything seems to be working just fine. I tried it in IE7 + Firefox.

    What browser are you using? It may be the browser.

    -OR- better yet, try clearing your cache, and then try to reproduce the error again. At least on my side, it's working just fine.

    Update us on what happens. Good luck.
    - Josh

  7. #7
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi jshor,

    i created a workaround last night. if you go to the site, go to the about page, then go to "home" again, its actually loading a duplicate copy of the home page, the difference is that the duplicate copy doesn't have the tracking code at the bottom so it won't make the page crash. not the best solution and probably not good for SEO but it'll do for now since its working. any other suggestions would be great. thanks,

    Jeff

  8. #8
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Glad things worked out
    - Josh

  9. #9
    Join Date
    Jul 2009
    Location
    Coquitlam BC Canada
    Posts
    46
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    try
    Code:
    require_once("page name");

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
  •