HTML form action with php
<form id="cat_insert" method="POST" action="admin-process.php?action=cat_insert" onsubmit="return false;">
I found this format of HTML form in the sample code provided by my teacher. I know apply php code after submitting the form would use
action="admin-process.php". But I don't understanding what is "?" after the php in this case, and the meaning of on submit.
?at the end of
admin-process.php?action=cat_insertdenotes where the url parameters begin. This allows you to pass information from one page to the next using the
GETmethod. This is in addition to the parameters passed through to
admin-process.phpby the form which use the
GETmethod is useful for passing a reasonable amount of non sensitive data between pages, while the
POSTmethod has less limitations and is best for more sensitive data.
In this instance you could obtain the value of
admin-process.phpby using either
$_REQUESTincludes the contents of