Is there anyway to get all the key from a form that I post?
My problem found when I am showing some data that get from mysql DB.
When I am showing 2 records, I posted 2 of the record to another PHP file.
But I am afraid when I was posting the record, someone is adding another record to the DB
My PHP will get 3 posted data instead of 2 (The user only post 2, because he/she is not refresh the form)
+--------------------+--------------------+
| Form | DB |
|--------------------|--------------------|
| 2 records | 2 records |
| 2 records | 3 records | Someone Insert it
+--------------------+--------------------+
Of course I can get $_POST['key1'], $_POST['key2'].
But my code will search for $_POST['key1'], $_POST['key2'], $_POST['key3'], because there are 3 records in the DB.
Is there a way to check what key only that the user POST?
1 Answer