I'm totally new to php and I'm trying to get a 'simple' php-script to work.
The script is supposed to send me an e-mail IF the user has answered all questions on my site AND checked all necessary radio-buttons. But even if i do all this, i get the error saying i left some questions unanswered.
Here's the code:
- Code: Select all
<?php
if($submit) {
if($name AND $email AND $text1 AND $text2 AND $radio1 AND $radio2 AND $radio3 AND $radio4 AND $radio5 AND $radio6 AND $radio7 AND $text3 AND $from) {
$name; // inneholder navnet på avsender
$email; // inneholder avsenders epost-adresse
$text1; // inneholder avsenders beskjed til deg
$text2; //tekstfelt
$radio1; //jjj
$radio2;
$radio3;
$radio4;
$radio5;
$radio6;
$radio7;
$text3;
$receiver = "monagullbekkhansen@hotmail.com";
$subject = "Mail sent from my site";
$from = "From: $name <$email>";
if(mail($receiver,$subject,$text1,$text2,$radio1,$radio2,$radio3,$radio4,$radio5,$radio6,$radio7,$text3,$from)) {
echo "The email was sent";
}
} else {
echo "The email cannot be sent because you left some questions unanswered";
}
} else {
echo "This page contains a mail-script. You have arrived here without using this mail-script";
}
echo "<a href=\"index.html\">Back</a>";
?>
Would really appreciate all help you guys can give me
Thanks





