kjmeath Posted July 2, 2007 Share Posted July 2, 2007 I am using the mail function in a contact form and it used to work correctly, but for some reason it is not working anymore...the domain is: http://www.zistyle.info/cultivatedcloset/contact.php heres the code (please dont comment on its quality, i already know it needs a few improvements...i still have some revamping to do on it, but it did work 3 days ago....) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- <?php if ( count($_POST) > 0){ if ($first_name == "" ){ $tar1= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink></span> PLEASE ENTER YOUR <span class=\"a7\">FIRST NAME</span>"; } elseif ($last_name == ""){ $tar2= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink></span> PLEASE ENTER YOUR <span class=\"a7\">LAST NAME</span>"; } elseif(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email1)) { $tar3= "<span class=\"a7\"><blink>*</blink></span>"; $tar4= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink> INVALID EMAIL ADDRESS</span>"; } elseif ($email1 != $email2 ) { $tar3= "<span class=\"a7\"><blink>*</blink></span>"; $tar4= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink> EMAILS DO NOT MATCH</span>"; } elseif ($themessage == ""){ $tar5= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink> PLEASE ENTER A MESSAGE</span>"; } else { $name= "$first_name $last_name \n"; $re="Hey Zi, $name sent you a message from the zistyle.info website. \n"; $body ="$re \n"; $body.="$first_name wrote: \n"; $body.="$themessage \n \n"; $body.="$first_name's email is: $email1 \n"; mail("$email1", "Auto-reply from Zi Ata", "Thank you $first_name, \n I will reply to your message by contacting you through your $email1 email address, please allow up to 72 hours for a response to your message: \"$themessage\" \n once again \n Thank You \n \n Zi Ata"); mail("thekidwicked@gmail.com", "Zi, $name sent you a message from the zistyle.info website", $body); header("Location: thankyou.html"); } } else { $message="<span class=\"a7\"><blink>*</blink></span> Be sure to fill in the all required fields <span class=\"a7\"><blink>*</blink></span>"; } ?> --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Zi Style</title> <link rel="stylesheet" href="css.css" type="text/css" /> </head> <body id="backgroundcolor"> <a name="top"></a> <div align="center" id="headerbox">A Cultivated Closet</div> <div id="navcontainer"> <ul id="navlist"> <li><a href="index.html">About</a></li> <li><a href="biography.html">Biography</a></li> <li><a href="process.html">The Process</a></li> <li><a href="pricing.html">Pricing</a></li> <li><a href="portfolio.html">Portfolio</a></li> <li><a href="calendar.html">Calendar</a></li> <li id="active"><a href="contact.php" id="current">Contact</a></li> </ul> </div> <div id="content"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <div align="center"> <div id="a5">-Contacting Zi Ata- </div> <br /> <table width="550px" cellspacing="0" cellpadding="0"> <tr> <td> <div align="center"> <table width="400" cellspacing="0" cellpadding="1"> <tr> <th colspan="2" align="left"> <?php echo $message; ?> </th> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please Enter Your <span class="a7"> First Name </span> </div> </td> <td> <?php echo $tar1; ?> <input type="text" name="first_name" value="<?php echo $_POST['first_name']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please Enter Your <span class="a7"> Last Name </span> </div> </td> <td> <?php echo $tar2; ?> <input type="text" name="last_name" value="<?php echo $_POST['last_name']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please Enter Your <span class="a7"> Email Address </span> </div> </td> <td> <?php echo $tar3; ?> <input type="text" name="email1" value="<?php echo $_POST['email1']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please <span class="a7"> Verify </span> Your Email Address </div> </td> <td> <?php echo $tar4; ?> <input type="text" name="email2" value="<?php echo $_POST['email2']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="400px" align="center"> <?php echo $tar5; ?> <span class="a7"> Enter your message below </span> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5000" align="center"> <textarea name="themessage" rows="7" cols="50"><?php echo $_POST['themessage']; ?></textarea> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" align="center"> <input name="submit" type="submit" value="Send" /> <input name="reset" type="reset" value="Reset" /> </td> </tr> </table> </div> </td> </tr> </table> </div> </form> </div> <div id="mainimg"></div> <div align="center"> <br /> <span class="a3"> <a href="../">Home</a> <span class="a4">-</span> <a href="index.html">About</a> <span class="a4">-</span> <a href="biography.html">Biography</a> <span class="a4">-</span> <a href="process.html">The Process</a> <span class="a4">-</span> <a href="pricing.html">Pricing</a> <span class="a4">-</span> <a href="portfolio.html">Portfolio</a> <span class="a4">-</span> <a href="calendar.html">Calendar</a> <span class="a4">-</span> <a href="contact.php">Contact</a> <span class="a4">-</span> <a href="../stageright/">Stage Right</a> </span> </div> <div align="center"> <span class="a1">© 2007 Zi Style</span> </div> <br /> </body> </html> Quote Link to comment Share on other sites More sharing options...
kjmeath Posted July 2, 2007 Author Share Posted July 2, 2007 the problem that is occuring is that i am not recieveing any email, both the sender and reciever are not getting the messages Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 mail("thekidwicked@gmail.com", "Zi, $name sent you a message from the zistyle.info website", $body); that is correct so the reason maybe the html comment <!-- just a guess and maybe the condition dont reach the else Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 ops comment still works any way where are the declaration of the variables u put in the if statement Quote Link to comment Share on other sites More sharing options...
kjmeath Posted July 2, 2007 Author Share Posted July 2, 2007 okay i changed the code, which has not made a change...heres thenew code: <?php if ( count($_POST) > 0){ if ($first_name == "" ){ $tar1= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink></span> PLEASE ENTER YOUR <span class=\"a7\">FIRST NAME</span>"; } elseif ($last_name == ""){ $tar2= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink></span> PLEASE ENTER YOUR <span class=\"a7\">LAST NAME</span>"; } elseif(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email1)) { $tar3= "<span class=\"a7\"><blink>*</blink></span>"; $tar4= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink> INVALID EMAIL ADDRESS</span>"; } elseif ($email1 != $email2 ) { $tar3= "<span class=\"a7\"><blink>*</blink></span>"; $tar4= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink> EMAILS DO NOT MATCH</span>"; } elseif ($themessage == ""){ $tar5= "<span class=\"a7\"><blink>*</blink></span>"; $message="<span class=\"a7\"><blink>*</blink> PLEASE ENTER A MESSAGE</span>"; } else { $name= "$first_name $last_name \n"; $re="Hey Zi, $name sent you a message from the zistyle.info website. \n"; $body ="$re \n"; $body.="$first_name wrote: \n"; $body.="$themessage \n \n"; $body.="$first_name's email is: $email1 \n"; mail("$email1", "Auto-reply from Zi Ata", "Thank you $first_name, \n I will reply to your message by contacting you through your $email1 email address, please allow up to 72 hours for a response to your message: \"$themessage\" \n once again \n Thank You \n \n Zi Ata"); mail("thekidwicked@gmail.com", "Zi, $name sent you a message from the zistyle.info website", $body); header("Location: thankyou.html"); } } else { $message="<span class=\"a7\"><blink>*</blink></span> Be sure to fill in the all required fields <span class=\"a7\"><blink>*</blink></span>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Zi Style</title> <link rel="stylesheet" href="css.css" type="text/css" /> </head> <body id="backgroundcolor"> <a name="top"></a> <div align="center" id="headerbox">A Cultivated Closet</div> <div id="navcontainer"> <ul id="navlist"> <li><a href="index.html">About</a></li> <li><a href="biography.html">Biography</a></li> <li><a href="process.html">The Process</a></li> <li><a href="pricing.html">Pricing</a></li> <li><a href="portfolio.html">Portfolio</a></li> <li><a href="calendar.html">Calendar</a></li> <li id="active"><a href="contact.php" id="current">Contact</a></li> </ul> </div> <div id="content"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <div align="center"> <div id="a5">-Contacting Zi Ata- </div> <br /> <table width="550px" cellspacing="0" cellpadding="0"> <tr> <td> <div align="center"> <table width="400" cellspacing="0" cellpadding="1"> <tr> <th colspan="2" align="left"> <?php echo $message; ?> </th> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please Enter Your <span class="a7"> First Name </span> </div> </td> <td> <?php echo $tar1; ?> <input type="text" name="first_name" value="<?php echo $_POST['first_name']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please Enter Your <span class="a7"> Last Name </span> </div> </td> <td> <?php echo $tar2; ?> <input type="text" name="last_name" value="<?php echo $_POST['last_name']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please Enter Your <span class="a7"> Email Address </span> </div> </td> <td> <?php echo $tar3; ?> <input type="text" name="email1" value="<?php echo $_POST['email1']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="300px"> <div align="left">Please <span class="a7"> Verify </span> Your Email Address </div> </td> <td> <?php echo $tar4; ?> <input type="text" name="email2" value="<?php echo $_POST['email2']; ?>" /> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500px"> <tr> <td width="400px" align="center"> <?php echo $tar5; ?> <span class="a7"> Enter your message below </span> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5000" align="center"> <textarea name="themessage" rows="7" cols="50"><?php echo $_POST['themessage']; ?></textarea> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" align="center"> <input name="submit" type="submit" value="Send" /> <input name="reset" type="reset" value="Reset" /> </td> </tr> </table> </div> </td> </tr> </table> </div> </form> </div> <div id="mainimg"></div> <div align="center"> <br /> <span class="a3"> <a href="../">Home</a> <span class="a4">-</span> <a href="index.html">About</a> <span class="a4">-</span> <a href="biography.html">Biography</a> <span class="a4">-</span> <a href="process.html">The Process</a> <span class="a4">-</span> <a href="pricing.html">Pricing</a> <span class="a4">-</span> <a href="portfolio.html">Portfolio</a> <span class="a4">-</span> <a href="calendar.html">Calendar</a> <span class="a4">-</span> <a href="contact.php">Contact</a> <span class="a4">-</span> <a href="../stageright/">Stage Right</a> </span> </div> <div align="center"> <span class="a1">© 2007 Zi Style</span> </div> <br /> </body> </html> Quote Link to comment Share on other sites More sharing options...
kjmeath Posted July 2, 2007 Author Share Posted July 2, 2007 how should i declair the vars before the if statement? Quote Link to comment Share on other sites More sharing options...
kjmeath Posted July 2, 2007 Author Share Posted July 2, 2007 anyone up for this challenge?, it still doesnt work.....i dont think its a script problem, its problem with apache or php5 software.... im using apache 2.2 & php 5.x.x Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 2, 2007 Share Posted July 2, 2007 $first_name,$last_name,$email1,$email2 where do you declare those variable ? and this if ( count($_POST) > 0){ are u using the post method can we see the html form Quote Link to comment Share on other sites More sharing options...
kjmeath Posted July 3, 2007 Author Share Posted July 3, 2007 the form is in the code above, and the form worked on the 29th of june, without declairing the vars....even after i declair the vars, it does not work,..... Quote Link to comment Share on other sites More sharing options...
thedarkwinter Posted July 3, 2007 Share Posted July 3, 2007 Are you using linux? (postfix?) Why dont you have a look at the mail log and see what it says, it may give you some useful info: probably: /var/log/mail.log (or something similar) If you are using windows, then im not sure where the mail log is. cheers, tdw Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.