Jump to content

Recommended Posts

Ok this has only started happening since I started using classes, on some pages when you go to them the page flashes white for a second or two before beginning to load, I know this is not normal behaviour because what normally happens is you click a link and the page you are on stays on the screen until the next page has loaded then it switches instantly...

 

I'm sure it's something related to my code as it on some pages this doesn't happen and on others it does... I can post the code if you want but I'll just see what people have to say first.

 

Thanks a lot.

Link to comment
https://forums.phpfreaks.com/topic/73169-page-flashing/
Share on other sites

After a little checking I found that the files where this happens seem to have require_once more than the pages where it doesn't happen, perhaps it is something related to that?

 

EDIT: I changed all instances of require_once to require and the page in question no longer flashes, this is indeed strange. Does anyone have any idea why this happens?

Link to comment
https://forums.phpfreaks.com/topic/73169-page-flashing/#findComment-369080
Share on other sites

I am most definitely not, no... One thing I was doing was using require_once() for the header and footer files as well as the classes/functions, I changed everything to require() and the flashing ceased to exist. I should probably change it to include() as that's more suited for a header/footer I think.

 

Anyway I think I have solved my own problem but I would really like to know why require_once() causes this to happen where as require() does not.

 

Thanks again.

 

EDIT: Perhaps I was wrong, it did seem like it was something to do with require_once() but now the page where I changed everything to require() is flashing again. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/73169-page-flashing/#findComment-369087
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.