HTML form directing to a friendly URL [duplicate]
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.
精彩评论