Answer the question
In order to leave comments, you need to log in
Getting the selected radio item and passing it to the email body, how to display the selected item?
Hello.
I made a form, from the form I pass through the action to the php handler to send a letter to the mail.
Normal fields without problems I can give.
There are items that you need to select by marking, and this is radio.
How do I pass the selected item in the message of the letter.
There are 3 possible options.
<input type="radio" name="radio" id="radio1" value="Deck Officer" checked="checked">
<label for="radio1">Deck Officer</label>
<input type="radio" name="radio" id="radio2" value="Engine Officer">
<label for="radio2">Engine Officer</label>
<input type="radio" name="radio" id="radio3" value="Rating">
<label for="radio3">Rating</label>
$radio1 = Arr::get($_POST, 'radio1');
$radio2 = Arr::get($_POST, 'radio2');
$radio3 = Arr::get($_POST, 'radio3');
$message = '<h2>Анкета с сайта</h2>'. '<br/><br/>'
. ' <b>Main info</b><br/>'
. ' <b>Deck Officer</b>: ' . htmlspecialchars($radio1). '<br/>'
. ' <b>Engine Officer</b>: ' . htmlspecialchars($radio2). '<br/>'
. ' <b>Rating</b>: ' . htmlspecialchars($radio3). '<br/>'
;
Answer the question
In order to leave comments, you need to log in
"SELECT COUNT(id) as count FROM users WHERE email = ? LIMIT 0,1"
$mysqli = new mysqli(SERVER, DBUSER, DBPASS, DATABASE);
$result = $mysqli->query("SELECT `id` FROM `users` WHERE `email` = '$email' ");
if($result->num_rows == 0) {
// НЕТУ.
} else {
// ЕСТЬ.
}
$mysqli->close();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question