用HTML和PHP制作表格,但无法弄清楚出了什么问题 [英] Made a form in HTML and PHP but unable to figure out what is wrong

查看:70
本文介绍了用HTML和PHP制作表格,但无法弄清楚出了什么问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个表单,将数据通过电子邮件发送到电子邮件ID。

但是在填写表格并提交时,浏览器会说 - 服务器错误。检索http://localhost/process.php时网站遇到错误。



这是代码 -



form1.html



I made a form to email the data to an email ID.
But on filling up the form and submitting, the browser is saying - Server error. The website encountered an error while retrieving http://localhost/process.php.

Here is the code -

form1.html

<html>
<head>
<title>Form</title>
</head>
<body>

<form method = "post" action = "process.php">
Enter your name <input type = "text" name = "namee" id = "namee" value = "enter your name" />
Enter your phone number <input type = "text" name = "phone" id = "phone" />
<br>
<input type  = "submit" value = "post it!" />
</form>


</body>
</html>





process.php





process.php

<?php



$person_name = $_POST["namee"];

$person_number = $_POST["phone"];



$to = "example234671_1@gmail.com";

$subject = "form filled up";

$body = $person_name. "<br>" $person_number . "<br>" . $person_name ;


mail($to, $subject, $body);

echo "Thank you!" ;
?>





错误是什么?

推荐答案

person_name =
person_name =


_POST [ namee];

_POST["namee"];


person_number =
person_number =


这篇关于用HTML和PHP制作表格,但无法弄清楚出了什么问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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