lozbenson
10-30-2009, 07:33 PM
So far I have what is below, it sends and replies to emails like it is supposed to however I can not get it to show error messages in the area provided...
It seems not to show the error messages of confirmation...
if it is of help give it a go at www.erbimages.com/contact.php
just use demo demo demo etc in the fields...
PLEASE HELP... heres the script...
<?php
if(isset($_POST['send'])){
$to = $_REQUEST['sendto'] ; // change all the following to $_POST
$from = $_REQUEST['Email'] ;
$name = $_REQUEST['Name'] ;
$headers = "From: $from";
$subject = "Web Contact Data";
$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$fields{"Message"} = "Message";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: noreply@erbimages.com";
$subject2 = "Thank you for contacting us.";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usually within 48 hours.";
$send=false;
if($from == '') {$error= "You have not entered an email, please go back and try again";}
else {
if($name == '') {$error= "You have not entered a name, please go back and try again";}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
}
if(!isset($error) && !$send)
$error= "We encountered an error sending your mail, please notify service@erbimages.com"; }
}// end of if(isset($_POST['send']))
?>
<?php include("http://www.erbimages.com/php/head.php"); ?>
<?php include("http://www.erbimages.com/php/start.php"); ?>
<?php include("http://www.erbimages.com/php/topline/return.php"); ?>
<div class="section_right">
<ul id="section_contact">
<li>
<span id="section_header_right_contact">CONTACT</span>
</li>
<li>
<span id="section_txt">
<?php
if(isset($error))
echo '<span id="section_error">'.$error.'</span>';
if(isset($send) && $send== true){
echo 'Your message has been send. Thank you.';
}
if(!isset($_POST['send']) || isset($error))
?>
<form method="post" action="contact.php">
<p>Your Details</p>
<p><select name="sendto"><option value="info@erbimages.com">Information</option> <option value="hire@erbimages.com">Hire</option> <option value="rf@erbimages.com">Royalty Free</option> <option value="service@erbimages.com">Technical</option></select></p>
<p><font color=red>*</font> <font style="padding-right: 2em;">Name:</font><input size=25 name="Name"></p>
<p><font color=red>*</font> <font style="padding-right: 2em;">Email:</font><input size=25 name="Email"></p>
<p><font style="padding-right: 2em;">Company / Event:</font><input size=25 name="Company"></p>
<p>Message</p>
<p><textarea name="Message" rows=5 cols=35></textarea></p>
<p><input type=submit name="send" value="Submit"></p>
</form>
</span>
</li>
</ul>
</div>
<?php include("http://www.erbimages.com/php/quiet_footer.php"); ?>
<?php include("http://www.erbimages.com/php/end.php"); ?>
PLEASE HELP, I REALLY NEED YOU...
It seems not to show the error messages of confirmation...
if it is of help give it a go at www.erbimages.com/contact.php
just use demo demo demo etc in the fields...
PLEASE HELP... heres the script...
<?php
if(isset($_POST['send'])){
$to = $_REQUEST['sendto'] ; // change all the following to $_POST
$from = $_REQUEST['Email'] ;
$name = $_REQUEST['Name'] ;
$headers = "From: $from";
$subject = "Web Contact Data";
$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$fields{"Message"} = "Message";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: noreply@erbimages.com";
$subject2 = "Thank you for contacting us.";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usually within 48 hours.";
$send=false;
if($from == '') {$error= "You have not entered an email, please go back and try again";}
else {
if($name == '') {$error= "You have not entered a name, please go back and try again";}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
}
if(!isset($error) && !$send)
$error= "We encountered an error sending your mail, please notify service@erbimages.com"; }
}// end of if(isset($_POST['send']))
?>
<?php include("http://www.erbimages.com/php/head.php"); ?>
<?php include("http://www.erbimages.com/php/start.php"); ?>
<?php include("http://www.erbimages.com/php/topline/return.php"); ?>
<div class="section_right">
<ul id="section_contact">
<li>
<span id="section_header_right_contact">CONTACT</span>
</li>
<li>
<span id="section_txt">
<?php
if(isset($error))
echo '<span id="section_error">'.$error.'</span>';
if(isset($send) && $send== true){
echo 'Your message has been send. Thank you.';
}
if(!isset($_POST['send']) || isset($error))
?>
<form method="post" action="contact.php">
<p>Your Details</p>
<p><select name="sendto"><option value="info@erbimages.com">Information</option> <option value="hire@erbimages.com">Hire</option> <option value="rf@erbimages.com">Royalty Free</option> <option value="service@erbimages.com">Technical</option></select></p>
<p><font color=red>*</font> <font style="padding-right: 2em;">Name:</font><input size=25 name="Name"></p>
<p><font color=red>*</font> <font style="padding-right: 2em;">Email:</font><input size=25 name="Email"></p>
<p><font style="padding-right: 2em;">Company / Event:</font><input size=25 name="Company"></p>
<p>Message</p>
<p><textarea name="Message" rows=5 cols=35></textarea></p>
<p><input type=submit name="send" value="Submit"></p>
</form>
</span>
</li>
</ul>
</div>
<?php include("http://www.erbimages.com/php/quiet_footer.php"); ?>
<?php include("http://www.erbimages.com/php/end.php"); ?>
PLEASE HELP, I REALLY NEED YOU...