开发者

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

开发者 https://www.devze.com 2023-01-21 06:04 出处:网络
Is there a way to get the value of the name attribute in the form tag? I\'m using PHP and 开发者_如何学JAVAdon\'t see it in $_POST.

Is there a way to get the value of the name attribute in the form tag? I'm using PHP and 开发者_如何学JAVAdon't see it in $_POST.


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 hidden form element <input type="hidden"> containing the name.

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


<form name="wut">
    <input type="hidden" name="name" value="wut"/>
</form>
0

精彩评论

暂无评论...
验证码 换一张
取 消