Log in

View Full Version : PHP Form Problem



stewie316
06-11-2008, 07:42 AM
Please excuse me as i tryed to do a search and couldn't come up with a solution to this problem.

For some odd reason my form works great all goes well except for one thing... When people put in YOur Email: Email address <<< This only accepts Email addresses with @mydomain.com it won't accept or send from like yahoo.com or hotmail.com this might be a coding error or internal. I am using Yahoo business hosting and here is my scripts below.

application.php


<form action="contact.php" method=post>
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

Then the Table with the stuff in it....

The contact.php page has all the magic happening


<?php
$SendTo = "myemail@MYDOMAIN.com";
$from = $_REQUEST['Email'] ;
$name = $_REQUEST['Name'] ;
$headers = "From: $from";
$subject = "Joining Member";
$ip = $_POST['ip'];
$attn = $_POST['attn'];

$fields = array();
$fields{"Name"} = "Name";
$fields{"Email"} = "Email";
$fields{"Age"} = "Age";
$fields{"JoinATI"} = "Why are you joining?";
$fields{"Rules_1"} = "Agree's to the Rules ";
$body = "The following Guest submitted his Application from our website:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%100s: %s\n",$b,$_REQUEST[$a]); }
$message = " $todayis [EST] \n
";

if($from == '') {print "You have not entered an email, please go back and try again";}
else {
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
$send = mail($SentTo, $subject, $body, $headers);
if($send)
{header( "Location: http://www.website.org" );}
else
{print "We encountered an error sending your mail, please notify myemail@mydomain.org"; }
}
}
?>

After messing around with this for hours i still could not find out why people could not enter there email address and it not send to me..... But if i put in my email address or a email address with my domain in it it would work.