I have tried to do a handler in PHP that redirects you to a specific file if what you entered is matching with the respective name. When you try the first option (Apa si Cer), it redirects you to "notFound.html" different page instead of "Apa si Cer.html", but, if you try the second option (apa si cer), it redirects you to the "Apa si Cer.html" page. What's wrong? This is the handler:
<?php
$search = $_POST['Textbox'];
//Apa si Cer
if($search == "Apa si Cer") {
header("Location: Apa si Cer.html");
}
else {
header("Location: notFound.html");
}
if($search == "apa si cer") {
header("Location: Apa si Cer.html");
}
else {
header("Location: notFound.html");
}
?>
This is the Search bar
<form action="searchHandler.php" method="POST">
<input type="text" id="search" name="Textbox" title="Textbox" style="width: 300px;"><button id="go" name"Cauta" title="Buton" type="submit">Cauta!</button></form>
And this is notFound.html
<!DOCTYPE html>
<html>
<head>
<title>Despre Autor</title>
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width="device-width, initial-scale = 1.0">
<meta charset="UTF-8">
<meta http-quiv="X-UA-Compatible" content="ie=edge">
</head>
<body>
<h1 style="text-align: center; margin-top: 30px; color:red">Eroare 404</h1>
<h1 style="text-align: center; margin-top: 30px;">Pagina inexistenta</h1>
<a href="index.html" class="hrefmodify"><h1 style="text-align:center;"><u>Mergi spre Acasa</h1></a>
<a href="magazin.html" class="hrefmodify"><h1 style="text-align:center;">Mergi spre Magazin</u></h1></a>
</body>