seany123 Posted March 10, 2009 Share Posted March 10, 2009 I would like it so if the person tries to F5 or refresh the page.. nothing happens except him getting a echo or something. is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/ Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 sorry it client side look for a JavaScript/Ajax solution. http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_20914092.html an saw at the link read the whole page including side stuff. Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780822 Share on other sites More sharing options...
seany123 Posted March 10, 2009 Author Share Posted March 10, 2009 right okay. Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780825 Share on other sites More sharing options...
blueman378 Posted March 10, 2009 Share Posted March 10, 2009 that cant be right, i mean banks stop you from refreshing a page or going back all the time, surly thats not just client based? Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780858 Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 that cant be right, i mean banks stop you from refreshing a page or going back all the time, surly thats not just client based? blueman378, how can a server based programming language control the browser. so is it client based? Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780865 Share on other sites More sharing options...
Lyon Posted March 10, 2009 Share Posted March 10, 2009 Ideally, you do not want to disable refresh using javascript because people can always disable javascript in their browser and some browser just simply don't have javascript support, and your application could wind up being exploited, especially if you are using post data or sending information to a database. A better solution would be to redirect to another page that would make no difference if it were refreshed Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780876 Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 lyon that a real good point, but as much as i argue that java script/Ajax is useless the more i get insulted via others. but good point. Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780878 Share on other sites More sharing options...
blueman378 Posted March 10, 2009 Share Posted March 10, 2009 im not saying they dont use java but im saying they must have some form of serverside protection? Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780902 Share on other sites More sharing options...
.josh Posted March 10, 2009 Share Posted March 10, 2009 You can't stop the user from refreshing the page with php. It has to be done with javascript. What you can do is start a session and use a session var to track whether the user has gone to the page or not. User goes to page, session starts, var is set to 1 or true or whatever. User refreshes, new request sent to server, server checks for var. var exists, so display something different. Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-780943 Share on other sites More sharing options...
aschk Posted March 10, 2009 Share Posted March 10, 2009 I think when the op refers to "banks can do it" he means, when you're going through a "step" situation , like a transaction. What happens is that the server side (session) maintains a record of the last state you were in (i.e. step 3) , and on going "back" in the browser, or "refreshing" the server asks what step the last one was (from session info), and decides upon logic depending on that. You can't disable a persons browser capabalities. And even if you could I wouldn't recommend it as you're interfering with a common user interface (making your site less usable). Describe to us what your problem is and why you want to faciliate this. Is your problem regarding "double posting" of information? i.e. they fill in a form, post to another page, and then refresh that page (asking for re-post) ? Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-781015 Share on other sites More sharing options...
JonnoTheDev Posted March 10, 2009 Share Posted March 10, 2009 im not saying they dont use java but im saying they must have some form of serverside protection? like a php condom Quote Link to comment https://forums.phpfreaks.com/topic/148705-how-to-disable-page-refresh/#findComment-781104 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.