OK,
My php code re-runs whenever i do a "view source" inside of chrome. Is this normal? I'm trying to create an access token that expires when the page loads. Problem is, when you do the viewsource it creates a new access token.
Thank,s
PHP script runs again on "view source"
Moderator: General Moderators
- mecha_godzilla
- Forum Contributor
- Posts: 375
- Joined: Wed Apr 14, 2010 4:45 pm
- Location: UK
Re: PHP script runs again on "view source"
Hi,
I get this sometimes (though not all the time) when I'm working on an application of mine that can only be connected to over an SSL connection - when I try to view the page source in Firefox I get the source code for the login page instead i.e. as if no login credentials were sent.
I'm not sure if I can suggest anything to fix this issue because it may just be the way that some browsers work, but if you only need to view the page source for testing purposes you could echo() out the access token somewhere in your page template - this would tell you at least whether the access token is being regenerated on each page load as expected.
Hopefully some other forum members will have some more useful suggestions
HTH,
Mecha Godzilla
I get this sometimes (though not all the time) when I'm working on an application of mine that can only be connected to over an SSL connection - when I try to view the page source in Firefox I get the source code for the login page instead i.e. as if no login credentials were sent.
I'm not sure if I can suggest anything to fix this issue because it may just be the way that some browsers work, but if you only need to view the page source for testing purposes you could echo() out the access token somewhere in your page template - this would tell you at least whether the access token is being regenerated on each page load as expected.
Hopefully some other forum members will have some more useful suggestions
HTH,
Mecha Godzilla
Re: PHP script runs again on "view source"
@OP: Yes that is normal. I think the way in which 'View Source' works has changed since early versions of browsers. (Although i am unsure if even the early browsers in fact did load the page again)
If you are use Chrome's element inspector... you can actually view the source of the current page by not using the elements tab, but by viewing the file on the "Resources" tab.
You want to be looking in the "Frames" -> "(mypage.php)", and then underneath the sub items (Images,Scripts,Stylesheets) it should list the php file itself. You can click on this to show the source for the currently loaded page.
If you are use Chrome's element inspector... you can actually view the source of the current page by not using the elements tab, but by viewing the file on the "Resources" tab.
You want to be looking in the "Frames" -> "(mypage.php)", and then underneath the sub items (Images,Scripts,Stylesheets) it should list the php file itself. You can click on this to show the source for the currently loaded page.