0

This is a pretty nice script to go back 1 history:

<INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);>

But the problem is, if I executed any query or whatever on let's say addnewcustomer.php and than I link to companyview.php and using this code I go back to addnewcustomer.php, it executes the same query all over (or browser gives me a warning and have to hit F5). How to avoid this?

Thanks in advance.

nos
  • 223,662
  • 58
  • 417
  • 506
TMNuclear
  • 1,175
  • 5
  • 25
  • 49

1 Answers1

2

The best way to avoid these situations would be to:

  1. not change any data on GET requests, instead manipulate only on POST requests.
  2. implement post-to-get (303) redirect after any data manipulation.

You should then be good

Kris
  • 40,604
  • 9
  • 72
  • 101