Possible Duplicate:
Clean URLs for search query?
I made a php webpage for checking the color code,here is the first four line
if(isset($_GET['c']))
$hex = $_GET['c'];
elseif(!isset($_GET['c']))
$hex = $_POST['c'];
and my htaccess have:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9]{6})$ index.php?c=$1 [L]
if I type site.com/ffcdee it successfully show the color #ffcdee
but if i use the input box:
<form action="">
<input type="text" name="c" >
<input type="submit" value="Search" id="search-submit">
</form>
it show site.com/?c=ffcdee,
I tried change input name to other word,but the script not work anymore..
how can I remove the ?c= from the url?
Just use the http post method instead of http get:
When using http post requests the query arguments are not passed coded inside the url, instead they are handed over as a separate “body” of the request. The content of that body is what you finally get presented inside php as the $_POST superglobal variable.
If you want to understand how that works use a network sniffer like
wiresharkto dump the http traffic. You will see and understand the difference between get and post.