聯系官方銷售客服
1835022288
028-61286886
搜索功能想加入網站url參數請問應該怎么辦 剛剛問說是寫入表單隱藏域。。但是好像寫錯了 請教一下
搜索框
<form class="search-form" action="/index.php" method="get"> <input type="hidden" name="s" value="news"> <input type="hidden" name="c" value="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="搜索內容..." name="keyword" > <div class="input-group-btn"> <button class="btn default" type="submit"> <i class="glyphicon glyphicon-search"></i></button> </div> </div> </form>
內容搜索
<form class="search-form"> <div class="input-group"> <input type="text" class="form-control" placeholder="搜索內容..." name="keyword" value='{$keyword}' id='search_keyword' onkeypress="if(event.keyCode==13) {dr_module_search('search_keyword');return false;}"> <div class="input-group-btn"> <button class="btn default" type="button" onclick="dr_module_search('search_keyword')"> <i class="glyphicon glyphicon-search"></i></button> </div> </div> <script> // 這段js是用來執行搜索的 function dr_module_search(name) { var url="{Router::search_url($params, 'keyword', 'dayruicom')}"; var value = $("#"+name).val(); if (value) { location.href=url.replace('dayruicom', value); } else { $("#"+name).focus() dr_tips(0, "輸入關鍵字"); } return false; } </script> </form>
比如說https://127.0.0.1/html/xinwen.html?111 然后通過搜索按鈕后 會進入https://127.0.0.1/news/search/keyword-關鍵詞.html?111 這個頁面 然后url參數?111 不丟失
https://127.0.0.1/news/search/keyword-關鍵詞.html?111
這個是不合法的,不能加問號
應該這樣 https://127.0.0.1/news/search/keyword-關鍵詞-name-111.html
回復迅睿框架創始人 老大~ 這個是通過百度競價設置的URL訪問參數 我想通過我們的搜索功能這個參數不丟失~ http://127.0.0.1.com/html/jiameng.html?utm_source=sem_baidu_pc 比如通過新聞頁 新聞頁帶有?utm參數 然后通過搜索功能后搜索頁也帶有?utm參數 這樣可以實現嗎~ 不是帶-111這樣的 是?111這樣的
回復迅睿框架創始人 是在.html后面添加的?參數~
不能加參數,無解了,除非動態模式
無解了!