My contact form isn't sending messages although it says it is. Here is the website: spinalcordinjuryattorney.co Would really appreciate anyone's help. Thanks!
for this you will have to provide a code which you are using to send email. without that how can we figure out the problem?
<?php if ($_GET["email"] == "attempt"){ $to='admin@namesale.net'; $messageSubject='Message from ...'; $confirmationSubject='Confirmation of your emai message to ...'; $confirmationBody="Thank you for contacting us. Your case information has been sent and we will be in touch with you soon.\n\n"; $email=''; $body=''; $displayForm=true; $phone = $_POST['phone']; $name = $_POST['name']; if ($_POST){ $email=stripslashes($_POST['email']); $body=stripslashes($_POST['body']); // validate e-mail address $valid=eregi('^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$',$email); $crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$body); if ($email && $body && $valid && !$crack){ if (mail($to,$messageSubject,("Name: ".$name."\nPhone: ".$phone . "\nEmail: ". $email."\n\n". $body),'From: '.$email."\r\n")){ ?> <?php print ("<p class=\"success\">Thank you for contacting us. Your case information has been sent and we will be in touch with you soon.</p>"); ?> <?php }else{ // the messages could not be sent ?> <?php print ("<p class=\"fail\">Sorry, we're having problems with our server. Please contact us using the phone number above.</p>"); ?> <?php } }else if ($crack){ // cracking attempt ?> <?php print ("<p class=\"fail\">Please enter a valid email address and describe your case.</p>"); ?> <?php }else{ // form not complete ?> <?php print ("<p class=\"fail\">Please enter a valid email address and describe your case.</p>"); ?> <?php } } } ?> PHP: That's my contact form code... Does anything seem wrong?
What's weird about it? I would prefer using the original since it looks nice with the template I'm using.... Let me know. Thanks!
First off, your form is not linked to the processing code pasted above... If that processing code is in the contact.html page, then part of the problem is that the page is .html and not .php - ( unless using mod_rewrite ) Secondly the code above does have some issues... But I would first check the form being linked to the processor first... ===> <form action="PROCESSOR??" method="post">
That is the code inside send.php.... This is the code for the form itself: <form action="" method="post"> <fieldset> <input class="text" name="name" id="name" type="text" value="Name" /> </fieldset> <fieldset> <input class="text" name="email" id="email" type="text" value="Email" /> </fieldset> <fieldset> <input class="text" name="phone" id="phone" type="text" value="Primary Phone Number>" /> </fieldset> <fieldset> <textarea rows="" cols="" name="body" id="body">Please describe your case. </textarea> </fieldset> <p> <input class="submit" type="submit" value="Click Here to Send" /> </p> </form> Code (markup):
Just realized, I had to upload all php files. I had html files pointing to that send.php, which wasn't working... Everything is working fine now. Thanks for your help
Cheers to you for figuring it out!~ Your form action="" <== is blank... should be pointing to the send.php file for processing! Good Luck!!