kaliok Posted March 1, 2007 Share Posted March 1, 2007 Hi Im sure this questions if fairly common, however can't seem to find exactly what I need. I have a php page that load up data from a mysql database, into a table, next to each piece of data is a button that allows the user to move the data up and down the table using a linked list subroutine. The data in the database in changed appropriately after the hidden form the table submits to another php page which sends the update to the database, when it returns to the page the table is displayed correctly with the item in their new places, however if I press the back button the page is redisplayed with the items in their old position. I've tried using the following but it doesn't seem to work: <META HTTP-EQUIV=Refresh CONTENT="1; URL=ADMINTEST.php?pageselected=<?php echo $pageSelected ?>"> Could someone suggest a way to do this in php. I do have session data running for security reasons but can I add another session variable to the code that would expire or something? Or is there another way to do this. Preferably I would like to do it without using javascript. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/40729-back-button-problems/ Share on other sites More sharing options...
genericnumber1 Posted March 1, 2007 Share Posted March 1, 2007 While I'm not 100% sure what you meant, I think you mean you don't want people seeing the info before the change if they push their back button? It's probably the browser caching the page... since you can't control the user's cache the best bet you could do is to tell the browser it shouldn't cache the page... header('Cache-Control: no-cache'); http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 sorry if I totally missed your question. Link to comment https://forums.phpfreaks.com/topic/40729-back-button-problems/#findComment-197165 Share on other sites More sharing options...
kaliok Posted March 1, 2007 Author Share Posted March 1, 2007 I have tried adding the no-cache into the header. It doesn't seem to solve the problem, I may not have explained it well. Here is an example: Name Age Direction_A Direction_B Jack 30 - MoveDown Jill 28 Move Up MoveDown Bob 32 Move Up - After moving Bob UP 1 place by clicking on the MoveUp Button this table is displayed: Name Age Direction_A Direction_B Jack 30 - MoveDown Bob 32 MoveUp MoveDown Jill 28 MoveUp - However when I press the back button, the original table is displayed, the concequences of this are that if a user were to press the back button and then try and do something to do the data they would be using old data. I guess what I want to do is force the page to reload everytime with the data displayed in the correct place... Thanks for your help.... Link to comment https://forums.phpfreaks.com/topic/40729-back-button-problems/#findComment-197192 Share on other sites More sharing options...
kaliok Posted March 1, 2007 Author Share Posted March 1, 2007 I am still having problems with this, perhaps what I am asking for can't be done, could someone tell me what I need to do to have one of those windows popup, usually seen on sites that deal with form data not being reloadable. I think there is one on this site, but I can't seem to get it to work. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/40729-back-button-problems/#findComment-197352 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.