I'm looking for the best way to submit form parameters in PHP.
Send parameters in the URL:
<form method="post"
class="form-validate-jquery"
action="suppliers_sql.inc.php?a=edit_ctt&ctt_id=<? echo $supplier_contact_id ?>"
>
</form>
Send parameters in hidden
fields:
<form method="post" class="form-validate-jquery" action="suppliers_sql.inc.php">
<input type="hidden" name="a" value="edit_ctt" />
<input type="hidden" name="supplier_contact_id" value="<? echo $supplier_contact_id ?>" />
</form>
Which one is best?
答案 0 :(得分:3)
It much depends on the situation and both approaches are valid.
Personally I prefer to use hidden fields if possible, because of several reasons: