StackOverflowNewbie StackOverflowNewbie - 7 months ago 10
PHP Question

PHP: How to get name value in <form name="form1" />

Is there a way to get the value of the name attribute in the form tag? I'm using PHP and don't see it in $

_POST
.

Answer

Is there a way to get the value of the name attribute in the form tag? I'm using PHP and don't see it in $_POST.

No, the form's name attribute is never set to sent to the server as part of the POST data.

The easiest way around this would be adding a <input type="hidden"> containing the name.

<form name="myform" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="frmname" value=""/>
</form>