Log in

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



boycetown
09-02-2009, 10:08 PM
created a workaround. thanks

JShor
09-02-2009, 10:35 PM
When I click on 'Home' the page doesn't load and returns an error.

boycetown
09-02-2009, 10:38 PM
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.

JShor
09-02-2009, 10:38 PM
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 :o

boycetown
09-02-2009, 10:44 PM
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.

JShor
09-03-2009, 12:40 AM
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.

boycetown
09-03-2009, 07:03 PM
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

JShor
09-03-2009, 07:43 PM
Glad things worked out :)

fg123
09-04-2009, 08:45 PM
try

require_once("page name");