<? $a=$_POST["name"]; $b=$_POST["email"]; $c=$_POST["msg"]; $msg = $a."\n".$b."\n".$c; mail("[email protected]","反馈信息",$msg); ?><form name="form1" method="post" action=""> <input name="name" type="text" id="name"> <br> <input name="email" type="text" id="email"> <br> <textarea name="msg"></textarea><br> <input type="submit" name="Submit" value="提交"> </form> 我试了下以上这段代码,也报错了.Warning: Unknown(D:\mysite\phptest\127.0.0.1\phptest\zsub.php): failed to open stream: No such file or directory in Unknown on line 0Warning: (null)(): Failed opening 'D:\mysite\phptest\127.0.0.1\phptest\zsub.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0
mail("[email protected]", "My Subject", "Line 1\nLine 2\nLine 3");
?> 手册上有的!自己研究研究!
<form action=submit.php method=post>
<input type=text name=uname>
<input type=text name=uemail>
<textarea name=umsg></textarea>
<input type=submit>
</form>submit.html
<?php
$uname = $_POST('uname');
$uemail= $_POST('uemail');
$umsg= $_POST('umsg');
if ( mail("[email protected]", "My Subject", $umsg))
echo "Your email send out";
} else {
echo "We're experincing technology problem, please try later.";
}?> 你还可以添加更多的功能和校验。:-)
PHP怎么实现让客户提交请求的内容发到我的邮箱?比如: *姓名____,
*邮箱____,
*意见____。用户写完,按[提交] 可以把信息发到我的邮箱。哪位大哥能给个例子?谢谢!
$a=$_POST["name"];
$b=$_POST["email"];
$c=$_POST["msg"];
$msg = $a."\n".$b."\n".$c;
mail("[email protected]","反馈信息",$msg);
?><form name="form1" method="post" action="">
<input name="name" type="text" id="name">
<br>
<input name="email" type="text" id="email">
<br>
<textarea name="msg"></textarea><br>
<input type="submit" name="Submit" value="提交">
</form>
<form action="mailto:[email protected]">
...
</form>
有错误!!
Fatal error: Call to undefined function: array() in /home/abc/public_html/submit.php on line 2//test.htm<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>
</head><body>
<form action=submit.php method=post>
<input type=text name=uname>
<input type=text name=uemail>
<textarea name=umsg>
</textarea>
<input type=submit>
</form>
</body></html>//submit.php<?php
$uname = $_POST('uname');
$uemail= $_POST('uemail');
$umsg= $_POST('umsg');
if ( mail("[email protected]", "My Subject", $umsg)){
echo "Your email send out";
} else {
echo "We're experincing technology problem, please try later.";
}?>
$a=$_POST["name"];
$b=$_POST["email"];
$c=$_POST["msg"];
$msg = $a."\n".$b."\n".$c;
mail("[email protected]","反馈信息",$msg);
?><form name="form1" method="post" action="">
<input name="name" type="text" id="name">
<br>
<input name="email" type="text" id="email">
<br>
<textarea name="msg"></textarea><br>
<input type="submit" name="Submit" value="提交">
</form>
我试了下以上这段代码,也报错了.Warning: Unknown(D:\mysite\phptest\127.0.0.1\phptest\zsub.php): failed to open stream: No such file or directory in Unknown on line 0Warning: (null)(): Failed opening 'D:\mysite\phptest\127.0.0.1\phptest\zsub.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0
if ($_POST["send"]){
$a=$_POST["name"];
$b=$_POST["email"];
$c=$_POST["msg"];
$msg = $a."\n".$b."\n".$c;
mail("[email protected]","反馈信息",$msg);
}
?><form name="form1" method="post" action="">
<input name="name" type="text" id="name">
<br>
<input name="email" type="text" id="email">
<br>
<textarea name="msg"></textarea><br>
<input type="hidden" name="send" value="1">
<input type="submit" name="Submit" value="提交">
</form>