how can i remove prefix url value i.e slug= from the url is there any process please assist if there is i tried using str_pos but does not work
my url is http://localhost/blog/?slug=what-is-lorem-ipsum
what i expect http://localhost/blog/what-is-lorem-ipsum
here is my code
<?php
include('connect.php');
if(isset($_REQUEST['slug'])){
$sql = "SELECT * FROM `posts` WHERE `blog_slug` = '".$_REQUEST['slug']."'";
$result = mysql_query($sql) or die( "MySQL Error: ".mysql_error() );
$num_rows=mysql_num_rows($result);
if($num_rows>0){
while($rows = mysql_fetch_array($result)){
echo "<h3><a href='http://localhost/blog/?slug=".$rows['blog_slug']."'>".$rows['blog_title']."</a></h3>";
echo "<p>".$rows['blog_con']."</p>";
}
} else {
echo "Post Not Found.";
}
} else {
$sql = "SELECT * FROM `posts`";
$result = mysql_query($sql) or die( "MySQL Error: ".mysql_error() );
$num_rows=mysql_num_rows($result);
if($num_rows>0){
while($rows = mysql_fetch_array($result)){
echo "<h3><a href='http://localhost/blog/?slug=".$rows['blog_slug']."'>".$rows['blog_title']."</a></h3>";
}
} else {
echo "Post Not Found.";
}
}
?>