开发者

HTML form directing to a friendly URL [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

What is the best way to implement a friendly URL that has multiple variables using mo开发者_如何学Cd_rewrite?

I'm using mod_rewrite in my site for friendly URLs which works great. When using a form to add a variable to $_REQUEST it's being called in the regular format, and not the friendly one. My form is something simple like <input type="text" class="searchbox" id='searchid' name="query" value=""/> It now does directs to www.someurl.com?query="form data".

I would like it to direct to a "friendly URL", something like:

www.someurl.com/query/"form data"

How can I do that in PHP?


Why not put every thing in a POST request?

like this

<form method='post' action='/'>
   <input type='text' name='data' value='some value' />
</form>

the result in _request will be

array( 'data' => 'some value' )

and you still retain your url structure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜