php - Contact us mail error -
my html coding contact form html page , below php code
<form name="form1" method="post" action="contact.php" id="contactform"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td><input name="name" type="text" id="name" onfocus="cleardefault(this)" value="name" size="90" style="background: #daedff; border:1px solid #daedff; border-radius:3px; height: 25px;"></td> </tr> <tr> <td><input name="customer_mail" type="text" value="email" onfocus="cleardefault(this)" id="customer_mail" size="90" style="background: #daedff; border:1px solid #daedff; border-radius:3px; height: 25px;"></td> </tr> <tr> <td width="82%"><input name="subject" type="text" value="subject" onfocus="cleardefault(this)" id="subject" size="90" style="background: #daedff; border:1px solid #daedff; border-radius:3px; height: 25px;"></td> </tr> <tr> <td><textarea name="detail" cols="90" rows="8" id="detail" style="background: #daedff; border:1px solid #daedff; border-radius:3px;"></textarea></td> </tr> <tr> <td style="padding-left: 530px;"><input type="submit" name="submit" value="send" style="background: #1b99e8; border: 1px solid #1b99e8; color: #ffffff; border-radius:3px;"></td> </tr> </table> </form> contact.php file
<?php $subject = $_post['subject']; $detail = $_post['detail']; $customer_mail = $_post['customer_mail']; $name = $_post['name']; // contact subject $subject ="$subject"; // details $message="$detail"; // mail of sender $mail_from="$customer_mail"; // $header="from: $name <$mail_from>"; // enter email address $to ='it@reverseinformatics.com'; $send_contact=mail($to,$subject,$message,$header); // check, if message sent email // display message "we've recived information" if($send_contact){ echo '<script language="javascript">confirm("we have received request, our team contact shortly.")</script>'; echo '<script language="javascript">window.location = "contact.html"</script>'; } else { echo '<script language="javascript">confirm("oops sorry inconvinience.")</script>'; echo '<script language="javascript">window.location = "contact.html"</script>'; } ?> above code plz me overcome problem since have hosted in site, works in local server not working in website
i guess thee problem code @ window.location = "contact.html" part. if want redirect page, try giving absolute path. may try window.location.href or window.open. note window.open open in new window.
Comments
Post a Comment