Jump to content
  • 0

форма отправляет пустые поля


Olesiy
 Share

Question

Здравствуйте Дорогие форумчане! Может найдется у кого время и желание помочь, буду очень благодарна!Форма отправляет пустые поля ввода вместо заполненных не пойму в чем дело.Вот код формы пишу весь, но основное выделяю

<form class="form" action="mail.php" method="POST"">
    <input type="hidden" name="hidden_page_id" id="hiddenPageId" value="294508">
    <input type="hidden" name="hidden_main_form" id="hiddenMainForm" value="1">

<div class="contact_form">
<div class="form-group field-namephonecontactform-name required">
<input type="text" class="form-control" name="name" placeholder="Имя" aria-required="true">
<div class="help-block"></div>
</div>
<div class="form-group field-namephonecontactform-phone">
<input type="text" class="form-control" name="phone" placeholder="Телефон">
<div class="help-block"></div>
</div>    
<div class="form-group field-namephonecontactform-gender">
<div  placeholder=""></div>
</div>
</div>

<button type="submit" >ПОЛУЧИТЬ КАТАЛОГ</span></button>
        <div class="form-group field-namephonecontactform-order_id">

<input type="hidden" id="namephonecontactform-order_id" class="form-control" name="NamePhoneContactForm[order_id]" value="">
<div class="help-block"></div>
</div>
<div class="form-group field-namephonecontactform-crm_id">
<input type="hidden" id="namephonecontactform-crm_id" class="form-control" name="NamePhoneContactForm[crm_id]" value="">
<div class="help-block">
</div>
</div>
     </form>

Вот код php

<?php

$recepient = "avtochehol7@ya.ru";
$sitename = "Авточехлы 2";

$name = trim($_GET["name"]);
$phone = trim($_GET["phone"]);

$pagetitle = "Новая заявка с сайта \"$sitename\"";
$message = "Имя: $name \nТелефон: $phone";
mail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: $recepient");

Ссылка на сайт http://аавто-чехлы.рф/chexli/

Edited by Olesiy
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
1 час назад, Olesiy сказал:

<form class="form" action="mail.php" method="POST"">

У вас форма через POST отправляется, а переменные name и phone пытаетесь через GET получить. 
В документации пример#2: http://php.net/manual/ru/language.variables.external.php

Link to comment
Share on other sites

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