Jump to content
  • 0

input type="radio" отправка на email выбранного параметра [PHP]


xoff
 Share

Question

Нужно что бы на email выходил выбранный один из вариантов

Вот не полный вид формы:


<table width="100%">
<tbody>
<tr>
<td width="12%">Самовывоз: </td>
<td>
<input type="radio" name="deliver" value="Самовывоз" checked="checked">
Офис "Спектр-сб": ул.Ново-Садовая, 303 А<br>
</td>
</tr>
</tbody>
</table>
<table width="100%">
<tbody><tr>
<td width="12%">
Доставка:
</td>
<td>
<p>
<input type="radio" name="deliver" value="ООО Деловые линии">
ООО "Деловые линии" (сайт)
<br />
<input type="radio" name="deliver" value="ООО Автотрейдинг" />
ООО "Автотрейдинг" (сайт)
<br />
<input type="radio" name="deliver" value="ООО Байкал-Сервис" />
ООО "Байкал-Сервис" (сайт) <br />
<input type="radio" name="deliver" value="ООО ЖелдорЭкспедиция" />
ООО "ЖелдорЭкспедиция"(сайт) </p>
<tr>
</tr>
</tbody></table>

PHP такого вида:


<?php
$haveError = false;
if (isset($_POST['model'])) {$model = $_POST['model'];}
if (isset($_POST['email'])) {$email = $_POST['email'];}
if (isset($_POST['name'])) {$name = $_POST['name'];}
if (isset($_POST['surname'])) {$surname = $_POST['surname'];}
if (isset($_POST['post'])) {$post = $_POST['post'];}
if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
if (isset($_POST['fax'])) {$fax = $_POST['fax'];}
if (isset($_POST['activity'])) {$activity = $_POST['activity'];}
if (isset($_POST['rs_bank'])) {$rs_bank = $_POST['rs_bank'];}
if (isset($_POST['bank'])) {$bank = $_POST['bank'];}
if (isset($_POST['ks_bank'])) {$ks_bank = $_POST['ks_bank'];}
if (isset($_POST['bik'])) {$bik = $_POST['bik'];}
if (isset($_POST['okpo'])) {$okpo = $_POST['okpo'];}
if (isset($_POST['company'])) {$company = $_POST['company'];}
if (isset($_POST['inn'])) {$inn = $_POST['inn'];}
if (isset($_POST['kpp'])) {$kpp = $_POST['kpp'];}
if (isset($_POST['kol'])) {$kol = $_POST['kol'];}
if (isset($_POST['city'])) {$city = $_POST['city'];}
if (isset($_POST['state'])) {$state = $_POST['state'];}
if (isset($_POST['country'])) {$country = $_POST['country'];}
if (isset($_POST['zip'])) {$zip = $_POST['zip'];}
if (isset($_POST['address'])) {$address = $_POST['address'];}
if (isset($_POST['additional'])) {$additional = $_POST['additional'];}

$address = "Наш_email@spektr.ru";
$mes = "Модель: $model \nКоличество: $kol \nИмя: $name \nФамилия: $surname \nE-mail: $email \nДолжность: $post \nТелефон: $phone \nФакс: $fax \nОрганизация: $company \nСфера деятельности: $activity \nИНН: $inn \nКПП: $kpp \nР/с: $rs_bank \nБанк: $bank \nК/с: $ks_bank \nБИК: $bik \nОКПО: $okpo \nГород: $city \nОбласть: $state \nСтрана: $country \nПочтовый индекс: $zip \nАдрес: $addres \nДополнительная информация: $additional";
$send = mail ($address,$message,$mes,"Content-type:text/plain; charset = UTF-8\r\nFrom:$email");

?>

Edited by xoff
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy