I have this is the listing page: <div class="group"><a href="/category?id=<?php echo $data->slug;?>"><?php echo $data->title; ?></a></div>
I have this https://example.com/category/?id=slug
but I want this https://example.com/category/slug-id
Then I have this in the /category/index.php
if(get_magic_quotes_gpc())
{$uid = htmlentities(stripslashes(strip_tags(trim($pid))));}
try {$stmt = $db->prepare("select * from answers where ans_slug =:pid");
$stmt->execute(array(':pid' => $pid));
$row = $stmt->fetch();
} catch(PDOException $e) {
echo $e->getMessage();
}
if($row['ans_slug'] == '' || empty($pid)){
header('Location: ./');
exit;
}
Please help