I want to set a cookie but it wont work. Im pretty new in PHP but I searched on the internet how to set a cookie, but it doesn't work.
<div id="content">
<?php
if(isset($_GET['search-item']) && !isset($_COOKIE["searchRequest"])) {
setcookie("searchRequest", $_GET['search-item']);
include 'search_engine.php';
}
else {
$page = $_COOKIE['page'];
if(isset($page)){
require_once $page;
}
else {
require_once 'startpage.php';
}
}
?>
</div>
I really dont know what Im doing wrong :( Can someone help me and explain why this wont work. Everything else works flawlessly