Answer the question
In order to leave comments, you need to log in
How to return a 404 response?
Tell me how to give a 404 page correctly
. I have a template in which I determine by GET request whether there is an entry in the database and if so, then I show the page.
if (isset($_GET['shop'])) {
$offer = isset($_GET['shop']) ? str_replace(" ", "", $_GET['shop']) : null;
$sql = "SELECT * FROM shops WHERE link_shop = '".$offer."' ";
$result = mysqli_query($linkMain,$sql);
}
header("HTTP/1.0 404 Not Found");
if (mysqli_num_rows($result) > 0) {
} else {
// header("Location: /view/?shop=mvideo.ru");
// header("HTTP/1.0 404 Not Found");
header("Location: /404/");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question