I was working on a login that had a variable $pass for an access code to protect my shared documents on my home server. I have that working, but I just need the secure page the login redirects it to, to check for a session. If the session is equal to $hash, echo 'true';. If the session doesn't exist or has a different value, echo 'false';
I found two similar questions, but was unable to learn from them.
Nested tags in @if statement not recognized if statement not working php
This is what I got so far:
<?php
session_start();
require '/login/include.php'
if (isset($_SESSION['login'])) {
echo 'true';
} else {
echo 'false';
}
Everything else is working as expected, but this is my only problem.
Would this work or would the following code snippet work? How would this be implemented so it wouldn't give me a parse error?
if ($_SESSION['login'] == $hash)
Thank you for your time.
Aucun commentaire:
Enregistrer un commentaire