Let's say I have a website where the user can edit his profile.
<form action="profile-processor.php?action=edit&id=888" method="POST">
<input type="text" name="name"/>
<input type="submit"/>
</form>
And profile-processor.php contains:
if(!empty($_GET["action"])) {
if($_GET["action"] == "edit") {
$query = "UPDATE TABLE users SET name = ".$_POST["name"]." WHERE id = ".$_GET["id"];
... ... ...
}
}
What if someone that has nothing to do with this web application creates an HTML form, and in the action he puts "profile-processor.php?action=edit&id=xx" and sends the data? Will it edit like if it was sent from it's own website?
What can you do to hide the action or at least critical details like
<form action="process.php?action=SOMETHING_I_DONT_WANT_YOU_TO_SEE&id=THE_ID_YOU_SHOULD_NOT_KNOW">
</form>
I'm creating a web application that hast a lot of forms that will edit database information, I just want to make sure I have some critical security.
EDIT:::::::
I know how to use PDO and Prepared Statements perfectly, this question is more about the client-side stuff sending information to the Server side controller.