I am using MySQL and the ‘like’ query in order to find pages. I need to be able to do things this way, but this means that these pages will be the same:
http://www.mysite.com/blog/hello-world
http://www.mysite.com/blog/hello-worl
They both work, and bring up the same page. How (possibly using .htaccess?) can I get around this problem? :\
Many thanks
EDIT:
PHP –
if(isset($_GET['title'])) {
$blogtitle=mysql_real_escape_string($_GET['title']);
$title_two = strtolower(str_replace("-", " ", $blogtitle));
$title_two = strtolower(str_replace("?", "", $title_two));
$title_two = mysql_real_escape_string($title_two);
$postmatch = "select * from blog where title LIKE '%".$title_two."%' LIMIT 1;";
$postquery = mysql_query($postmatch) or die ("Could not match data because ".mysql_error());
$blogtitle=mysql_result($postquery,0,"title");
$title="$blogtitle";
Well you have the the URL : http://www.mysite.com/blog/hello-world WHERE hello world is the search string
I recommended you to store them into array like
Now you have the $SrcQryStr Query string You can make more condition on
if(!empty($keyWrd[0]) && MORE HERE)In here you can use implode or multiple implode instead of for loop.Now why %.$keywd.%
Example :
STRING : Welcome to Stack Overflow!
Searched Keyword : ack
it will show match found because ack found on Stack WHILE %.$keywd.%
it will not show match found because there is no word which starts with ack WHILE $keywd.%
it will not show match found because there is no exact word ack WHILE $keywd