Send id safety to php file

Discuss coding issues, and scripts related to PHP and MySQL.
Posts: 20

Send id safety to php file

i am using a query look like this:

this address "" send an id number to "" (and second address use GET method)

my problem:
user can see every query with change of id number at this code.
how can i prevent at this case?

this is very terrible. because user can delete every record in db with change of id number.

If the value /id is sent with GET method it will be displayed in the url address.
- The solution is to send that value with a <form> with POST method, and use the $_POST variable to get form data in php.

but in the address " """, data (id number) send with tag <a href> to this address "",
so i cant use, form and $_POST.

In this case you have to make safety the Insert, Update, Delete data in database.
1. You can add a login admin script that sets a Session with logged admin.
2. Execute Insert, Update, Delete only when the logged admin session is set.
3. Perform those instruction with $_POST data only.

Similar Topics