Jump to content

Session Help!


JasperHope

Recommended Posts

I need to know who the user is, so I have this running when the user types a password:

<?php if ( htmlspecialchars($_POST['password']) == 'Password'){
$_SESSION['userid'] = "Admin";
header('Location: http://www.example.com');
}
?>

It redirects you to this:

<?php
session_start();
if ($_SESSION['userid'] == "Admin") {
echo "You are Admin";
} else {
echo "You are not Admin";
}
?>

 

However, it returns: "You are not Admin".

 

Any suggestions ?

Link to comment
https://forums.phpfreaks.com/topic/198847-session-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.