PHP表单动作PHP自我 [英] php form action php self

查看:140
本文介绍了PHP表单动作PHP自我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < form name =form1id =mainFormmethod = postenctype =multipart / form-dataaction =<?php echo $ _SERVER ['PHP_SELF'];?>> 

在表单操作中,我想使用页面名称带参数。如 house.php?p_id = 10111 。但$ _SERVER ['PHP_SELF']只给出 house.php (我的页面完整url为 house.php?p_id = 10111 这样)请帮我解决这个问题。感谢。

解决方案

如何将它留空,这有什么不妥?

 < form name =form1id =mainFormmethod =postenctype =multipart / form-dataaction => 

< / form>

另外,您可以省略操作属性,它将按预期工作。


I have a php form like this.

<form name="form1" id="mainForm" method="post"enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>">

</form

In form action I want to use page name with parameters. like house.php?p_id=10111 . But $_SERVER['PHP_SELF'] gives only the house.php (My page full url is house.php?p_id=10111 like this) Please help me to solve this problem. thanks.

解决方案

How about leaving it empty, what is wrong with that?

<form name="form1" id="mainForm" method="post" enctype="multipart/form-data" action="">

</form>

Also, you can omit the action attribute and it will work as expected.

这篇关于PHP表单动作PHP自我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆