0

我有一个搜索输入字段。

提交后它会重定向你search.php?keyword=(value from input)

我想像这样得到它

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

我只是不知道如何&cd=在网址中获取

代码

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

1 回答 1

3

If you mean by current directory, the directory or file path where the file is, try this as an additional input:

<input type="hidden" name="cd" value="<?PHP echo getcwd(); ?>" />
于 2013-11-13T12:51:40.267 回答