I’m working on a PHP login/register system, and the login sessions are done using… you guessed it… sessions.
However, sessions simply do not work. Here’s an example:
session_start();
$_SESSION['hi'] == "hi";
echo $_SESSION['hi'];
It outputs nothing.
My Googling has found me nothing except hints about register_globals. My host, 000webhost, has it set to off, could that have anything to do with it?
Okay, just got an answer and I realized how stupid I am (it was a mistake, I knew that). No need to post any more answers.
You need to use = instead of ==
== compares, your comparison evaluates to false, and nothing is modified. But with = you set new values.
Also .. turn on errors!!!