Skip to content
Advertisement

How to check duplicate but without refresh page? PHP

this is my coding. I want to check the duplicate data. If duplicate data exists, the alert will pop-out, but once I click on OK, it will go to a blank page and cannot return to the form. How to make it pop-out an alert but without refresh the page?

JavaScript

Advertisement

Answer

One of the solutions is to do a javascript redirection.

Try changing

JavaScript

to

JavaScript

Please also consider using parameterized prepared statement to avoid SQL injection, as Strawberry has mentioned. (you may refer to this: How can prepared statements protect from SQL injection attacks?)

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement