The shape php is not processed



  • The shape itself.

    <form method="POST" action="messages.php" name="msg">
    

    Сумма
    <input type="number" name="sum" class="input" required="required"><br>

    Тип <select form="msg" name="type" required="required">
    <option>нал</option>
    <option>безнал</option>
    </select><br><br>

    Назначение <select form="msg" name="target" required="required">
    <option>Транспорт</option>
    <option>Еда</option>
    <option>Личные нужды</option>
    </select><br><br>

    Заявка
    <textarea class="area" form="msg" name="text" required="required"></textarea><br><br>
    Комментарий к заявке
    <input type="text" name="comment" required="required" class="input"><br><br>
    <input type="hidden" name="tofin" value="1">
    <input type="hidden" name="status" value="принята">
    <input type="submit" name="submit" class="knopka">
    </form>

    Treatment code

    if(isset($_POST['sum']) &
    isset($_POST['type']) &
    isset($_POST['target']) &
    isset($_POST['text']) &
    isset($_POST['comment']) &
    isset($_POST['tofin']) &
    isset($_POST['status'])){

    $sql = "INSERT INTO
    messages
    SET
    login='".$_COOKIE['login'].",
    sum='".$_POST['sum']."',
    type='".$_POST['type']."',
    stats='".$_POST['status']."',
    target='".$_POST['target']."',
    text='".$_POST['text']."',
    comment='".$_POST['comment'].",
    tofin=".$_POST['tofin'];
    $query = mysql_query($sql);
    echo mysql_error();
    }

    This section of the code is passed and executed by the final other.
    Is there a problem with the names of the fields or the method? I looked it up, but I never found anything.



  • Look towards the blocks:

    <option>нал</option>
    <option>безнал</option>
    

    <option>Транспорт</option>
    <option>Еда</option>
    <option>Личные нужды</option>

    by fact target and type They come empty. Vertical synthaxis for example type:

    <select form="msg" name="type" required="required">
    <option value="нал">нал</option>
    <option value="безнал">безнал</option>
    </select>

    Well, it's better to check through. && To conduct.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2