聯(lián)系官方銷售客服
1835022288
028-61286886
搜索功能想加入網(wǎng)站url參數(shù)請問應(yīng)該怎么辦 剛剛問說是寫入表單隱藏域。。但是好像寫錯了 請教一下
搜索框
<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="搜索內(nèi)容..." name="keyword" > <div class="input-group-btn"> <button class="btn default" type="submit"> <i class="glyphicon glyphicon-search"></i></button> </div> </div> </form>
內(nèi)容搜索
<form class="search-form"> <div class="input-group"> <input type="text" class="form-control" placeholder="搜索內(nèi)容..." 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是用來執(zhí)行搜索的 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, "輸入關(guān)鍵字"); } return false; } </script> </form>
比如說https://127.0.0.1/html/xinwen.html?111 然后通過搜索按鈕后 會進(jìn)入https://127.0.0.1/news/search/keyword-關(guān)鍵詞.html?111 這個頁面 然后url參數(shù)?111 不丟失
https://127.0.0.1/news/search/keyword-關(guān)鍵詞.html?111
這個是不合法的,不能加問號
應(yīng)該這樣 https://127.0.0.1/news/search/keyword-關(guān)鍵詞-name-111.html
回復(fù)迅??蚣軇?chuàng)始人 老大~ 這個是通過百度競價設(shè)置的URL訪問參數(shù) 我想通過我們的搜索功能這個參數(shù)不丟失~ http://127.0.0.1.com/html/jiameng.html?utm_source=sem_baidu_pc 比如通過新聞頁 新聞頁帶有?utm參數(shù) 然后通過搜索功能后搜索頁也帶有?utm參數(shù) 這樣可以實(shí)現(xiàn)嗎~ 不是帶-111這樣的 是?111這樣的
回復(fù)迅??蚣軇?chuàng)始人 是在.html后面添加的?參數(shù)~
不能加參數(shù),無解了,除非動態(tài)模式
無解了!