Jump to content

Help with BACK Button


mike1313

Recommended Posts

how is the update initiated? Do you use a $_GET variable, or a form button or what?

 

 

I think that the solution would be not to try to disable navigation, but to make the code so that the update only happens when you want it to happen regardless of a user pressing a back button.

Link to comment
https://forums.phpfreaks.com/topic/44883-help-with-back-button/#findComment-217937
Share on other sites

After you update the database, you could register a session variable. Then do an if before you update to check and see if they've already did it.

 

 

if( !session_is_registered(dbupdated)){

$sql = "UPDATE table etc..";

session_register("dbupdated");

}else{

echo "Already updated info.";

}

 

Not sure how secure this is, but it will help when they Refresh the page too, also causing the db to be updated again.

Link to comment
https://forums.phpfreaks.com/topic/44883-help-with-back-button/#findComment-218130
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.