Php cookies


#1

I have an Issue with a cookie.
I would like to check if it was set so that if it is not I can let a JS run
to tell the user to enable cookies so that the site works properly.
And yes I have to use cookies.

Here is my code:

<!DOCTYPE html>
<?php	 
setcookie(text, test, time() + (86400 * 30));
				 ?>





<html>
	<body>
		<?php
			  if(isset($_COOKIE['text'])){
				  echo"Succes";
			  }else{
				  echo "Hater";
			  }
				 
			  ?>
		</body>
</html>

Thanks in advance.

Peace out,
ColeBrookstone