聯(lián)系官方銷售客服
1835022288
028-61286886
如何寫表單偽靜態(tài)規(guī)則,
網(wǎng)站表單的URL
1、前端訪問表單的提交頁面
/index.php?s=form&c=ceshi&m=post
2、前端表單的數(shù)據(jù)列表頁面
/index.php?s=form&c=ceshi
3、前端表單的數(shù)據(jù)詳情頁面
/index.php?s=form&c=ceshi&m=show&id=表單內(nèi)容ID
=====================
模塊表單URL
1、前端訪問表單的提交頁面
/index.php?s=news&c=ceshi&m=post&cid=模塊對應(yīng)的內(nèi)容ID
2、前端表單的數(shù)據(jù)列表頁面
/index.php?s=news&c=ceshi&cid=模塊對應(yīng)的內(nèi)容ID
3、前端表單的數(shù)據(jù)詳情頁面
/index.php?s=news&c=ceshi&m=show&cid=模塊對應(yīng)的內(nèi)容ID&id=表單內(nèi)容ID
這個(gè)要你提供URL格式,我才能幫你寫出解析規(guī)則
回復(fù)迅??蚣軇?chuàng)始人
我水平有限,看我這樣表達(dá)是否能行。
網(wǎng)站表單的URL
1、前端訪問表單的提交頁面 /index.php?s=form&c=wzbd&m=post
偽靜態(tài)格式:/form/wzbd-post.html
2、前端表單的數(shù)據(jù)列表頁面 /index.php?s=form&c=wzbd
偽靜態(tài)格式:/form/wzbd.html
3、前端表單的數(shù)據(jù)詳情頁面 /index.php?s=form&c=wzbd&m=show&id=表單內(nèi)容ID
偽靜態(tài)格式:/form/wzbd/show-id.html
===================== 模塊表單URL
1、前端訪問表單的提交頁面 /index.php?s=news&c=modform&m=post&cid=模塊對應(yīng)的內(nèi)容ID
偽靜態(tài)格式:/news/modform/post-cid.html
2、前端表單的數(shù)據(jù)列表頁面 /index.php?s=news&c=modform&cid=模塊對應(yīng)的內(nèi)容ID
偽靜態(tài)格式:/news/modform/cid.html
3、前端表單的數(shù)據(jù)詳情頁面 /index.php?s=news&c=modform&m=show&cid=模塊對應(yīng)的內(nèi)容ID&id=表單內(nèi)容ID
偽靜態(tài)格式:/news/modform/show-id.html
純手寫,未測試,應(yīng)該不會有問題
config/rewrite.php
回復(fù)迅睿框架創(chuàng)始人
規(guī)則寫到rewrite.php里面。做測試如下:瀏覽器直接手動輸入www.abc.com/form/wzbd.html,頁面可以訪問,應(yīng)該解析規(guī)則生效了。
疑問1:瀏覽器訪問www.abc.com/index.php?s=form&c=wzbd,url不會自動跳轉(zhuǎn)到偽靜態(tài)格式的www.abc.com/form/wzbd.html
疑問2:表單數(shù)據(jù)列表頁面,各個(gè)指向數(shù)據(jù)詳情頁面的title鏈接仍然是動態(tài)的鏈接?怎么沒有變成偽靜態(tài)格式了呢
表單要手動改地址,把原來的URL地址手動改成你的規(guī)則組裝URL
回復(fù)迅??蚣軇?chuàng)始人
是否像這帖的思路方法:
http://223987.com/wenda/12022.html
列表還得手動組合URL
<a target="_blank" href="/{MOD_DIR}/{$t.cid}/{$form_table}-{$t.id}">
{MOD_DIR}=模塊名
{$t.cid} = 表單所屬內(nèi)容的id
{$form_table} = 表單名
{$t.id} = 表單發(fā)布的內(nèi)容id
在網(wǎng)站表單模板form_list.html里瞎改了,看起來可以用。
{form form=$form_table page=1 urlrule=$urlrule pagesize=5}
<li>
<a href="{$form_table}/show-{$t.id}.html" class="title">{dr_strcut($t.title, 60)}</a><span>{$t.inputtime}</span>
</li>
{/form}
是這樣做的,表單都要手動組裝url
回復(fù)@豬肉販子
/form/{$form_table}/show-{$t.id}.html
應(yīng)該這樣寫吧,對應(yīng)的是 /form/wzbd/show-id.html