如何在textboxes和url变量中使用变量进行搜索? [关闭]

I would like the following features:

  • variable stays in textbox after search button clicked
  • variables in the url
  • When i change the url (edit the url) & refresh, variables put into textbox and new search is made

There is many pages to my search. All of them use ajax except the first page. So how can I also put what page the search result is on in the url?

<form name="search1" action="/search.php" method="post">
            <input type="hidden" name="action" value="search">
                <div class="box">
                    <span>What:</span>
                    <input type="text" placeholder="job title, keywords or company" value="{keyword}" name="keyword" />

                    <em>job title, keywords or company</em>
                </div>
                <div class="box">
                    <span>Where:</span>
                    <input type="text" placeholder="city or postcode" value="" name="location" />
                    <em>city</em>
                </div>

                <div class="box box_submit">
                    <input type="submit" value="FIND" class="max" name="" />
                    <input type="submit" value="SEARCH" class="min" name="" />
                </div>

            </form>

The url of the search only shows /search.php and I want the variables to be in there too.

</div>

Change Your Form Method to Get :

<form name="search1" action="/search.php" method="Get">

Like this the variables will be shown in the url I hope this will help you