homepage Welcome to WebmasterWorld Guest from 23.22.173.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
My form stop working since 2 days
Please help me to correct the code
SEO_Baroda

5+ Year Member



 
Msg#: 11256 posted 3:54 pm on Jan 5, 2006 (gmt 0)

I use very simple form for feedback php mailform.
But, it suddenly stoped working since i changd my website design.
Can you please check the code and correct it? I'll be really thankful to you for that.

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 &nbsp;:-&nbsp; </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]&nbsp;:-&nbsp; </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>:-&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN
class=style19>:</SPAN>-&nbsp;&nbsp;
<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 &nbsp;:-</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>
&nbsp;&nbsp;
<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]

 

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 11256 posted 5:22 pm on Jan 5, 2006 (gmt 0)

Welcome to WebmasterWorld [webmasterworld.com], SEO_Baroda.

What is no longer working? It is no longer sending email? If you are on a shared server, did your host make any changes?

SEO_Baroda

5+ Year Member



 
Msg#: 11256 posted 9:06 am on Jan 6, 2006 (gmt 0)

nope my host didnt made any changes
i suddenly stop getting emails from my form
can any 1 plz help me out?

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 11256 posted 4:06 pm on Jan 6, 2006 (gmt 0)

If everything else is working except the mail() function then I would start troubleshooting at that point. There are some advisories listed on the mail() [php.net] page that you might try.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved