pgabriel Posted May 21, 2007 Share Posted May 21, 2007 Hello, I`m trying to rewrite the search.php. I don`t know well apache coding. Maybe you can help me. In search.php (at top) i wrote this: $string = (isset($_GET["string"])?tnormalise($_GET["string"],":\."):""); $usr = (isset($_GET["usr"])?intval($_GET["usr"]):0); if ($usr) { $url = $baseHREF."search/".urlencode($string); header("Location: ".$url); exit(); } The search form: <form action="<?php print $baseHREF; ?>search.php"> <p> <b>Search in:</b> <input type="radio" name="search" value="Description" checked> Description <input type="radio" name="search" value="Keywords"> Keywords <input type="radio" name="search" value="Title"> Title <input type="radio" name="search" value="Company"> Company </p><p> <b>Search for:</b> <input type="text" size="50" name="string" value="<?php print (isset($string)?$string:""); ?>"> <input type="submit" value="Search"> <input type='hidden' name='usr' value='1' /> </p><p> <b>Match:</b> <input type="radio" name="match" value="Any" checked> Any word <input type="radio" name="match" value="All"> All words <input type="radio" name="match" value="Exact"> Exact phrase </p> </form> I`ve tried something with apache but.. doesn`t work: RewriteRule ^search/(.*)$ search.php?string=$1{QUERY_STRING} [L] I would like the search to look like this: domain.com/search/search+string Now it looks like this: search.php?search=Description&string=searched+word&usr=1&match=Any Where "Description" and "Any" are some values from search form. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.