Home>

Hello, I created a poll. But for some reason, no matter what poll item was chosen, only the first option always comes to the mail. (This is from radio-type include). Why is this happening? could you help in this regard? Here is the survey structure:

<
div id= "opros" >
<
div class= "three_quarter" >
<
h1 >
Guys this is a poll! <
/h1 >
<
img src= "images /opros.png" style= "float: right;" width= "320" alt= "" >
<
div >
<
b >
Enter F AND O: <
/b >
<
input id= "fio" type= "text" name= "fio" />
<
br />
<
/div >
<
div style= "padding: 20px 0 0 0;" >
<
b >
Questions: <
/b >
<
/div >
<
div style= "padding: 10px 0;" >
<
b >
You: <
/b >
Man <
input id= "sex" type= radio name= "sex" value= "Male" >
Woman <
input id= "sex" type= radio name= "sex" value= "Woman" >
<
/div >
<
div style= "padding: 10px 0;" >
<
b >
Why did you go to University? <
/b >
<
br >
<
input id= "zachem" type= radio name= "zachem" value= "To learn and learn new things!" >
 To learn and learn new things! <
br >
<
input id= "zachem" type= radio name= "zachem" value= "Meet new people." >
 Meet new people. <
br >
<
input id= "zachem" type= radio name= "zachem" value= "Just get a diploma, I already know more than they teach!" >
 Just to get a diploma, I already know more than they teach! <
br >
<
/div >
<
div style= "padding: 10px 0;" >
<
b >
Please rate the level of acquired knowledge at our university: <
/b >
<
br >
<
input id= "raiting" type= radio name= "raiting" value= "They teach terrible, nothing is clear!" >
 They teach terribly, nothing is clear! <
br >
<
input id= "raiting" type= radio name= "raiting" value= "They teach well, but they can do better!" >
 They teach normally, but it can be better! <
br >
<
input id= "raiting" type= radio name= "raiting" value= "I like everything, they teach perfectly, everything is clear!" >
 I like everything, they teach perfectly, everything is clear! <
br >
<
/div >
<
div style= "display: inline-block; width: 100%;" >
<
div style= "padding: 10px 0; float: left;" >
<
b >
How do you like the site? <
/b >
<
br >
<
input id= "rait" type= radio name= "rait" value= "Very bad" >
 Very bad <
br >
<
input id= "rait" type= radio name= "rait" value= "Don't" >
 Don't <
br >
<
input id= "rait" type= radio name= "rait" value= "Catering" >
 Catering <
br >
<
input id= "rait" type= radio name= "rait" value= "Just right" >
 Just right <
br >
<
input id= "rait" type= radio name= "rait" value= "Very cool" >
 Very cool <
br >
<
input id= "rait" type= radio name= "rait" value= "MASTERPIECE!" >
 MASTERPIECE! <
br >
<
/div >
<
p id= "al" style= "margin-top: 50px; width: auto; margin-left: 250px; color: blue; font-size: 24px;" >
<
/p >
<
/div >
<
div style= "clear: both;" >
<
input id= "opr" type= "submit" value= "Submit" />
<
/div >
<
/div >
<
/div >

jquery script:

<script type= "text /javascript" > $ (document) .ready (function () {
$ ("# opr"). Click (function () {
var fio= $ ("# fio"). val ();
var sex= $ ("# sex"). val ();
var zachem= $ ("# zachem"). val ();
var raiting= $ ("# raiting"). val ();
var rait= $ ("# rait"). val ();
$ .post ("../scripts /mail.php",
{
fio: fio,
sex: sex,
zachem: zachem,
raiting: raiting,
rait: rait
},
function (data) {
$ ("# al"). Html (data);
}
);
});
});
<
/script >

And the pkhp sending the letter itself:

if (isset ($ _ POST)) {
    $ fio= ($ _POST ['fio']);
    $ sex= ($ _POST ['sex']);
    $ zachem= ($ _POST ['zachem']);
    $ raiting= ($ _POST ['raiting']);
    $ rait= ($ _POST ['rait']);
        if ($ fio!= '') {
            $ to= "[email protected]";
            $ subject= "Robot";
            $ message= "<
html >
<
head >
<
/head >
<
body >
                        The site answered the questions! <
br >
<
br >
                        <
table border= 1 >
                        <
tr >
<
td width= 10 >
<
b >
Answers received: <
/b >
<
/td >
<
/tr >
                        <
tr >
<
td >
<
b >
F AND O: <
/b >
<
/td >
<
td >
". $ fio." <
/td >
<
td >
". $ sex." <
/td >
                        <
tr >
<
td >
<
b >
Why did you enter the University: <
/b >
<
/td >
<
td >
 ". $ zachem." <
br >
<
/td >
<
/tr >
                        <
tr >
<
td >
<
b >
Knowledge gained: <
/b >
<
/td >
<
td >
 ". $ raiting." <
/td >
<
/tr >
                        <
tr >
<
td >
<
b >
Site rating: <
/b >
<
/td >
<
td >
 ". $ rait." <
/td >
<
/tr >
                        <
/tr >
<
/table >
<
br >
                        <
/body >
<
/html >
";
            $ headers= "MIME-Version: 1.0 \ r \ n";
            $ headers.= "Content-type: text /html; charset= utf-8 \ r \ n";
            $ headers.= "From: Birthday Reminder <
[email protected]>\ r \ n ";
            $ headers.= "Cc: [email protected] \ r \ n";
            $ headers.= "Bcc: [email protected] \ r \ n";
            mail ($ to, $ subject, $ message, $ headers);
            echo "Thank you for taking our survey, this information is very important to us!";
        } else {
            echo "You did not fill in the F&O field!";
        }
}