cnrars Posted September 23, 2008 Share Posted September 23, 2008 Hi all, Please help me about mod rewrite using Apache on WinVista, Pls check my codes HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>Articles Search</TITLE> <meta name="generator" content="Namo WebEditor v5.0"> </HEAD> <BODY> <CENTER> <BR><BR> <FORM NAME="ArticlesSearch" ACTION="Search.php" METHOD="POST"> <INPUT TYPE="TEXT" NAME="SearchString"> <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Search"> </FORM> </CENTER> </BODY> </HTML> PHP (Paging) <? header("Content-Type: text/html; charset=ISO-8859-9"); //Connect to DB mysql_connect("localhost","root","eskom0661") or die("Unable to connect to SQL server"); mysql_select_db("eskomweb") or die("Unable to SELECT DB"); mysql_query("SET NAMES 'latin5'"); $Limit = 5; //Number of results per page $SearchString=$_POST["SearchString"]; // Get the search tearm If($SearchString == "") $SearchString=$_GET["SearchString"]; // Get the search tearm If($SearchString == "") { Echo"Nothing to Search For"; exit(); } $page=$_GET["page"]; //Get the page number to show If($page == "") $page=1; //If no page number is set, the default page is 1 //Get the number of results $SearchResult=mysql_query("SELECT * FROM cat WHERE CatName LIKE '%$SearchString%' ORDER BY ID") or die(mysql_error()); $NumberOfResults=mysql_num_rows($SearchResult); //Get the number of pages $NumberOfPages=ceil($NumberOfResults/$Limit); $SearchResult=mysql_query("SELECT * FROM cat WHERE CatName LIKE '%$SearchString%' ORDER BY ID LIMIT " . ($page-1)*$Limit . ",$Limit") or die(mysql_error()); While($row = mysql_fetch_object($SearchResult)) { Echo $row->CatName . "<BR>"; } $Nav=""; If($page > 1) { $Nav .= " <A HREF=\"Search.php?page=" . ($page-1) . "&SearchString=" .urlencode($SearchString) . "\"><< Prev</A> "; } For($i = 1 ; $i <= $NumberOfPages ; $i++) { If($i == $page) { $Nav .= " <B> $i </B> "; }Else{ $Nav .= "<A HREF=\"Search.php?page=" . $i . "&SearchString=" .urlencode($SearchString) . "\">$i</A>"; } } If($page < $NumberOfPages) { $Nav .= "<A HREF=\"Search.php?page=" . ($page+1) . "&SearchString=" .urlencode($SearchString) . "\">Next >></A>"; } Echo "<BR><BR>" . $Nav; ?> .htaccess code: Options +FollowSymLinks RewriteEngine on RewriteRule Search-page-(.*)-SearchString-(.*)\.htm$ /listeleme/Search.php?page=$1&SearchString=$2& httpd.conf LoadModule rewrite_module modules/mod_rewrite.so <Directory "C:/php/www"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </directory> But is not work. Please help me, Thank you. Quote Link to comment Share on other sites More sharing options...
trq Posted September 23, 2008 Share Posted September 23, 2008 *.so files are for use with Linux, maybe you meen.... LoadModule rewrite_module modules/mod_rewrite.dll ? Quote Link to comment Share on other sites More sharing options...
cnrars Posted September 23, 2008 Author Share Posted September 23, 2008 *.so files are for use with Linux, maybe you meen.... LoadModule rewrite_module modules/mod_rewrite.dll ? How can i do? Quote Link to comment Share on other sites More sharing options...
cnrars Posted September 23, 2008 Author Share Posted September 23, 2008 Hello, I Solved! Thank you ########### AllowOverride None to AllowOverride All ########### 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.