QAZI
QAZI

Reputation: 15

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

        <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>

Upvotes: 0

Views: 636

Answers (1)

Xavier Poinas
Xavier Poinas

Reputation: 19733

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.

Upvotes: 3

Related Questions