0
Web
my input data keeps on adding on database when i refresh my page. how to stop it? I already use header and locate it in the same page but error says that "redirected too many times".
3 Answers
+ 1
This happens because when you refresh the page the request is executed again and again.
To stop this after it happens for the first time, create a Boolean variable "insert" and set it to true initially.
Only perform the insertion to database if insert == true.
Else, don't perform.
You may set insert to false after first insertion.
+ 1
Amey Bhavsar thank you, i'll try this
0
Remember to make the variable as a SESSION variable