Forum Moderators: coopster
This is my Mail.php code
<?
function checkOK($field)
{
if (eregi("\r",$field) ¦¦ eregi("\n",$field)){
die("Invalid Input!");
}
}
$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$comments=$_POST['comments'];
checkOK($comments);
$to="info@example.com, c.krunal@example.com";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
---------------------------------------------------
Ths is my code which i placed in mailform
<FORM action=mail.php method=post>
<div align="center">
<table width="508" border="1" align="center" cellpadding="1" cellspacing="1">
<TR bordercolor="#333333" bgcolor="#F3C28A">
<TD height=100% colspan="2" class=homarial1 style32 style35><SPAN
class=style19>Your Full Name :- </SPAN><FONT
color=#000000>
<INPUT size=54 name=name>
</FONT></TD>
</TR>
<TR bordercolor="#333333" bgcolor="#FFCC66">
<TD height=100% colspan="2" class=homarial1 style32 style35><div align="left"><SPAN
class=style19>Phone No [Day time] :- </SPAN><FONT color=#000000>
<INPUT size=54
name=name>
</FONT></div></TD>
</TR>
<TR bordercolor="#333333" bgcolor="#F3C28A">
<TD height="100%" colspan="2" class=homarial1 style32 style35><div align="left"><span class="style36"><strong>E-mail</strong>span>
<SPAN class=style19>:- </SPAN> <FONT
color=#000000>
<INPUT size=54. name=name>
</FONT></div></TD>
</TR>
<TR bordercolor="#333333" bgcolor="#FFCC66">
<TD height="100%" colspan="2" class=homarial1 style32 style35><div align="left"><SPAN class=style19>Website URL</SPAN><FONT
color=#000000><FONT color=#000000> <SPAN
class=style19>:</SPAN>-
<input name="name" type="text" value="http://www." size="54">
</FONT></FONT></div></TD>
</TR>
<TR bordercolor="#333333">
<TD width=32% height=100% valign="middle" bgColor=#F3C28A class=homarial1 style32 style35><div align="left"><SPAN
class=style19>Suggestion/Comment/<br>
Inquiry :-</SPAN> </div></TD>
<TD width=68% valign="middle" bgColor=#F3C28A class=homarial1 style32 style35><div align="left"><FONT color=#000000>
<TEXTAREA name=comments rows=3 cols=53></TEXTAREA>
</FONT></div></TD>
</TR>
</table>
<span class="content style32 style35"><FONT color=#000000> </FONT></span>
<br>
<span class="content style32 style35"><FONT color=#000000><INPUT type=submit value=Submit name=Submit>
<INPUT type=reset value=Reset name=Reset> </FORM>
[edited by: coopster at 4:08 pm (utc) on Jan. 6, 2006]
[edit reason] generalized email addresses; fixed sidescroll [/edit]
What is no longer working? It is no longer sending email? If you are on a shared server, did your host make any changes?