Hi guys,
I'm having a problem with a php form script, everything works great but when the form is submitted, the email address displayed in the FROM field is the same as the one the form is submitted to (my own).
For this reason, I do not have the users email address and my autoresponder responds to me.
Is there anything I need to add in the script. If you would like to see the script please let me know.
Regards
Form Mail issue
Moderator: General Moderators
Re: Form Mail issue
can you please post the form so that we can find out the error in it?
-
bloodlinek0
- Forum Newbie
- Posts: 6
- Joined: Wed Oct 07, 2009 12:42 pm
Re: Form Mail issue
Code: Select all
<?php
/* Subject and Email Variables */
$emailSubject = 'iCoWEB Call Back Form Submission';
$webMaster = 'dazan@treadeverywhere.com';
/*Gathering Data Varialbes */
$name = $_POST['name'];
$number = $_POST['number'];
$comments = $_POST['comments'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Number: $number <br>
Comments: $comments <br>
EOD;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=us-ascii\r\n";
mail($webMaster, $emailSubject, $body, $headers);
/*Results Rendered as html*/
$theResults = <<<EOD
<!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 name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="Dazan Alyanai" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex">
<title>iCoWEB Solutions</title>
<link rel="shortcut icon" HREF="favicon.ICO">
<script type="text/javascript" src="assets/flash/swfobject.js"></script>
<script type="text/javascript" src="assets/js/contact.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {};
params.scale = "noscale";
params.salign = "tl";
params.wmode = "transparent";
var attributes = {};
swfobject.embedSWF("assets/flash/dockmenu.swf", "DockMenuDiv", "600", "165", "9.0.0", false, flashvars, params, attributes);
</script>
<link rel="stylesheet" type="text/css" href="styles.css">
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="assets/css/ie6styles.css" />
<![endif]-->
<style type="text/css">
<!--
#main_top_section {background:url('assets/images/top_section_global_652x173_q60.jpg') no-repeat; height: 304px; width: 652px; float: right}
h2 {clear:both; /*IE7 clear:both fix*/ min-height: 20px; padding: 148px 0 0 10px;}
h3 {padding-left: 12px;}
-->
</style>
<!--END OF SCROLLING INFO-->
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="assets/css/ie6styles.css" />
<![endif]-->
</head>
<body>
<div id="wrapper">
<div id="header_top">
<div style="float: right; padding-right: 25px">
<div id="login">
<form action="loginform.php" method="post" name="loginform" onSubmit="return ValidateForm(loginform);">
<table>
<tr>
<td style="text-align: right"><label for="Username"><p>Username: </p></label></td>
<td><input type="text" name="Username" size="12" /></td>
<td style="text-align: right"><label for="Password"><p>Password: </p></label></td>
<td><input type="text" name="Password" size="12" /></td>
<td style="text-align: right"><a href="javascript:document.loginform.submit()"
onmouseover="document.loginform.login.src='assets/images/login_button_65x12_over.png'"
onmouseout="document.loginform.login.src='assets/images/login_button_65x12.png'"
onclick="return val_form_this_page()">
<img src="assets/images/login_button_65x12.png" width="65" height="17" border="0" alt="Login" name="login" />
</a></td>
</tr>
</table>
</form>
</div><!--Login End-->
<div id="nav">
<ul id="menu">
<li><a href="index.html" class="top">HOME</a></li>
<li><a href="portfolio.html" class="top">PORTFOLIO</a></li>
<li><a href="" class="top">WEB</a>
<ul>
<li><a href="web.html">WEB DESIGN</a></li>
<li><a href="ecommerce.html">ECOMMERCE</a></li>
<li><a href="cms.html">CONTENT MANAGEMENT SYSTEM</a></li>
<li><a href="support.html">SUPPORT PACKAGES</a></li>
<li><a href="seo.html">SEO</a></li>
</ul>
</li>
<li><a href="graphic.html" class="top">GRAPHIC DESIGN</a></li>
<li><a href="hosting.html" class="top">HOSTING</a></li>
<li><a href="" class="top" style="background-color: #251982">CONTACT</a>
<ul>
<li><a href="faq.html">FAQ</a></li>
<li><a href="#" style="background-color: #251982">CONTACT US</a></li>
</ul>
</li>
</ul>
</div><!--Nav End-->
</div>
<div id="logo"></div>
</div><!--Header Top End-->
<div id="header_bottom">
<div id="main_top_section">
<h2><span style="color: #FFFFFF">THANK</span> YOU</h2>
</div><!--Main Top Section End-->
<div id="web"><img src="assets/images/confirmation/web_328x304_q60.jpg" width="328px" height="304px" alt="Web Design" /></div>
</div><!--Header_bottom End-->
<div id="main_section" style="margin-top: -131px">
<h3 style="padding: 10px 0">You have successfully submitted your form.</h3>
<p>One of our team will contact you shortly</p>
<p>If you would like to contact us immediately then please feel free to contact us by telephone on:</p>
<h3 style="padding: 5px 0 15px 0; font-size: 2em">0845 388 8718</h3>
<p><a href="javascript:javascript:history.go(-1)" class="standlink">Click here to go back to previous page</a> or <a href="index.html" class="standlink">Home Page</a></p>
<div id="main_footer"></div>
</div><!--Main Section End-->
</div><!--Wrapper End-->
<div id="footer">
<hr />
<ul class="inline_small">
<li><a href="#" class="standlink">Privacy Policy</a></li>
<li style="border-left: solid 1px #B1B1B1; border-right: solid 1px #B1B1B1"><a href="#" class="standlink">Terms & Conditions</a></li>
<li><a href="#" class="standlink">Site Map</a></li>
</ul>
<address>© 2009 iCoWEB Solutions.co.uk. All Rights Reserved</address>
<address>ABC Road, Area, BIrmingham, B9 9BB</address>
<address>0845 388 8718</address>
</div><!--End Of Footer-->
<div id="hidden"><img src="assets/images/login_button_65x12_over.png" width="65" height="17" alt="Login" /></div>
</body>
</html>
EOD;
echo "$theResults";
?>