Posted June 21 '09 at 02:15 PM
Posts: 25
Hey everyone.
I found a script that I wanted to use that allows users to register to your website, access members-only pages, have their own profiles, ect...
But there seems to be a problem with the code that I have to put on the pages that I want to be members-only.
Here is the code:
<?php
$username = $_COOKIE['loggedin'];
if (!isset($_COOKIE['loggedin'])) die("You are not logged in, <a href="login.html">click here</a> to login.");
echo "You are logged in $username";
?>
Every time I try to run it, it tells me there's an error on this line:
if (!isset($_COOKIE['loggedin'])) die("You are not logged in, <a href="login.html">click here</a> to login.");
I do not know much of PHP, so I can't tell if anything is wrong.
It would be much appreciated if anyone could help me.