form to email problem here!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ejiro2x
Forum Newbie
Posts: 22
Joined: Thu Apr 19, 2007 7:48 am

form to email problem here!!!!!

Post 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]
shwanky
Forum Commoner
Posts: 45
Joined: Thu Feb 15, 2007 1:21 am

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

Post 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.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

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

Post 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.
Post Reply