0

Всем привет.

Есть форма:

<form method="POST" action="action.php">
    <input type="text" name="action">
    <input type="submit" name="submit">
</form>

Нужно чтобы при клике на submit url становился вида: site.com?search=MySearch

2
  • интересно, зачем вам выставлять на показ все ваши переменные? 20 сен 2013 в 5:58
  • 1
    ghost rider, если это поиск, то что бы была возможность скинуть линку другу. обычный юзкейс.
    – mirus
    20 сен 2013 в 8:58

2 ответа 2

5

У вас способ передачи POST, попробуйте так:

<form method="GET" action="action.php">
    <input type="text" name="action">
    <input type="submit" name="submit">
</form>
1
<form method="POST" action="action.php?search=MySearch">
    <input type="text" name="action">
    <input type="submit" name="submit">
</form>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.