php表单提交POST提交不上

源代码如下<!DOCTYPEhtml><html><body><formaction="excal.php"method="post">Name:<label><inpu... 源代码如下
<!DOCTYPE html>
<html>

<body>
<form action="excal.php" method="post">
Name:<label><input type="text" name="name"></label><br>
E-mail:<label><input type="text" name="email"></label><br>
<input type="submit">

</form>
</body>
</html>

PHP里代码
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
我是在mac电脑上用PHPstorm编写的然后不好用的
展开
 我来答
林羽凡
2016-11-21 · TA获得超过1302个赞
知道小有建树答主
回答量:484
采纳率:100%
帮助的人:272万
展开全部

您好

我刚才测试了一下,代码是正确的。


另外,建议对POST进行isset($_post['']),empty($_post['']) if --else 判断,不然有些地方可能会出现错误提示。

追问


我是在mac电脑上用PHPstorm编写的,编译之后就这样了

追答
connot modify header information- header 提示头部加这个试下:
header("content-type:text/html;charset=utf-8");

undefined index:email 的提示加判断:

if(isset($_GET['email'])){
echo $_GET['email'];
创新金点子
2016-11-21 · TA获得超过228个赞
知道小有建树答主
回答量:322
采纳率:80%
帮助的人:64.9万
展开全部
看你代码没错,是不是PHP环境问题?
更多追问追答
追问


我是在mac电脑上用PHPstorm编写的,编译之后就这样了

追答
确定是你的环境有问题,我本地测试了也没有问题。我的是 IIS+PHP
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式