Page 1 of 1

form to email problem here!!!!!

Posted: Sat Sep 08, 2007 9:12 am
by ejiro2x
hi i have a problem with my form to email script,its not working dunno why please kindly take a look

Code: Select all

<?php  
$msg = "Below is an Informaiton from a visitor from your website.
 \n\n";  
$msg .= "Full Name: $_POST[full_name]\n";  
$msg .= "Full Address: $_POST[full_address]\n";  
$msg .= "Date of Birth: $_POST[date_of_birth]\n";  
$msg .= "Telephone:  $_POST[home_telephone]\n";  
$msg .= "Fax Number:  $_POST[fax_number]\n";  
$msg .= "Nationality: $_POST[nationality]\n";   
$msg .= "Occupation: $_POST[occupation]\n";  
$meg .= "Company: $_POST[company]\n"; 
$msg .= "Email Address: $_POST[email_address]\n";  
$meg .= "General Information: $_POST[S1]\n"; 
$email =  $_POST[email];  
//set up the mail  
$subject = "Application";//$_POST[subject];  
$recipient =  //$_POST[recipient];  
$mailheaders = " $email";  
$mailheaders .= "Reply-To: $_POST[email]";  
//send the mail  
mail($recipient, $subject, $msg, $mailheaders);  


location ("");
?>
if theres a problem can someone please give me a script i can use & i want to insert my php script into my html script where do i place it[/syntax]

Re: form to email problem here!!!!!

Posted: Sat Sep 08, 2007 6:30 pm
by shwanky
ejiro2x wrote:hi i have a problem with my form to email script,its not working dunno why please kindly take a look

Code: Select all

<?php  
$msg = "Below is an Informaiton from a visitor from your website. \n\n";  
$msg .= "Full Name: $_POST[full_name]\n";  
$msg .= "Full Address: $_POST[full_address]\n";  
$msg .= "Date of Birth: $_POST[date_of_birth]\n";  
$msg .= "Telephone:  $_POST[home_telephone]\n";  
$msg .= "Fax Number:  $_POST[fax_number]\n";  
$msg .= "Nationality: $_POST[nationality]\n";   
$msg .= "Occupation: $_POST[occupation]\n";  
$meg .= "Company: $_POST[company]\n"; 
$msg .= "Email Address: $_POST[email_address]\n";  
$meg .= "General Information: $_POST[S1]\n"; 
$email =  $_POST[email];  
//set up the mail  
$subject = "Application";//$_POST[subject];  
$recipient =  //$_POST[recipient];  
$mailheaders = " $email";  
$mailheaders .= "Reply-To: $_POST[email]";  
//send the mail  

if(!mail($recipient, $subject, $msg, $mailheaders) )
     echo "o.O broken!";
else
     location ("");
?>
if theres a problem can someone please give me a script i can use & i want to insert my php script into my html script where do i place it
I'm assuming that the location() is a function that redirects? If that is the case it should only redirect if the mail is actually sent. Please see my changes.

Re: form to email problem here!!!!!

Posted: Sun Sep 09, 2007 6:29 am
by superdezign
ejiro2x wrote:hi i have a problem with my form to email script,its not working dunno why please kindly take a look
What part of it isn't working?
ejiro2x wrote:if theres a problem can someone please give me a script i can use & i want to insert my php script into my html script where do i place it
It's better that you fix the problem rather then give up and ask for handouts.