简体   繁体   中英

Html form on submit ? and &

I have got a search input field.

It redirects you after submit to search.php?keyword=(value from input)

I would like to get it like this

search.php?keyword=(value from input)&cd=(its the current directory I got a method to get this)

i just don't know how to get a &cd= in the url

Code

<form name="myform" action="search.php" method="GET">
<div class="filter-field">
    <div class="row">
     <div class="twelve columns">
      <div class="row collapse">
       <div class="nine mobile-three columns">
        <input type="text" name="keyword">
       </div>
       <div class="three mobile-one columns">

        <span class="postfix" onclick="myform.submit()"></span>
       </div>
      </div>
     </div>
    </div>
</div>
</form>

如果按当前目录,文件所在的目录或文件路径来表示,请尝试将其作为附加输入:

<input type="hidden" name="cd" value="<?PHP echo getcwd(); ?>" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM