通过php请求表格名称[关闭]

I want to retrieve NAME OF FORM from php when i am submitting a form. Can i find the NAME OF FORM by PHP?

No, but you can get the submit button name.

Short answer: No.

Long answer: If your PHP code is inline, I don't see why you couldn't use the form name in your PHP code. However, if your PHP code resides in a separate script and you're submitting your form to that script, then you need to explicitly pass in the name of the form through an input element (a hidden input element will work).

No, only successful controls are submitted. The name of the form is just for scripting. But you could use a hidden input to set a name for the form:

<form action="…">
    <input type="hidden" name="form-name" value="foobar">
</form>