Welcome Guest, Not a member yet? Register   Sign In
Prevent duplicate db's row
#1

HI , sorry for english , i have several anchor that create a row and redirect to modify this record . If i press the anchor 3 times before internet change page , are created 3 rows . How can i prevent this ?
Reply
#2

Don't press 3 times.
https://codeigniter.com/user_guide/libra...ttler.html
Reply
#3

(02-22-2022, 11:37 PM)iRedds Wrote: Don't press 3 times.
https://codeigniter.com/user_guide/libra...ttler.html

This can be used for a single user?
Reply
#4

Maybe.
Reply
#5

Do not use anchor to create a row.
Reply
#6

(02-23-2022, 12:31 AM)kenjis Wrote: Do not use anchor to create a row.

Anchor or form Is the same for this problem, or not?
Reply
#7

(02-23-2022, 12:31 AM)kenjis Wrote: Do not use anchor to create a row.

I agree with @kenjis .
In addition, this is not a REST approach.
By sending a POST request, you can add a CSRF check, which should not allow you to send more than 1 request with the same csrf token.
Reply
#8

(02-23-2022, 01:58 AM)iRedds Wrote:
(02-23-2022, 12:31 AM)kenjis Wrote: Do not use anchor to create a row.

I agree with @kenjis .
In addition, this is not a REST approach.
By sending a POST request, you can add a CSRF check, which should not allow you to send more than 1 request with the same csrf token.
Same problem with form , if i click on Button submit several time are created One row for every click
Reply
#9

(02-23-2022, 02:25 AM)pippuccio76 Wrote: Same problem with form , if i click on Button submit several time are created One row for every click

With CSRF protection?
Reply
#10

(02-23-2022, 02:42 AM)iRedds Wrote:
(02-23-2022, 02:25 AM)pippuccio76 Wrote: Same problem with form , if i click on Button submit several time are created One row for every click

With CSRF protection?
Yes in .env is set to true
Reply




Theme © iAndrew 2016 - Forum software by © MyBB