开发者

how we post value from one page to another page using php

开发者 https://www.devze.com 2023-02-22 06:21 出处:网络
<form name=\"frm1\" method=\"post\" action=\"/123/123/123/123/result_page.php\"> <td class=\"search_bar\"><input type=\"text\" name=\"textfield\"style=\"width:95%; height:28px; border:0
        <form name="frm1" method="post" action="/123/123/123/123/result_page.php">
        <td class="search_bar"><input type="text" name="textfield"  style="width:95%; height:28px; border:0px;"开发者_运维技巧 /></td>
        <td class="search_btn"><a href="/123/123/123/123/result_page.php?searchCity=<?php $_POST['textfield'] ?>"></a></td>
        </form>


Add a submit button to your form:

<form name="frm1" method="post" action="/123/123/123/123/result_page.php">
  <td class="search_bar">
    <input type="text" name="searchCity" />
  </td>
  <td class="search_btn">
    <input type="submit" value="Search" />
  </td>
</form>

Having a link as you have will bypass the form and generate a GET request, not a POST.

0

精彩评论

暂无评论...
验证码 换一张
取 消