Page 1 of 1

trouble getting variables from a session

Posted: Mon Jun 11, 2007 3:01 pm
by suthie
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i am trying to make user login sessions and i am having trouble retrieving variables from a session

this is my file check.html:

Code: Select all

welcome!<br />
<?php
session_start();
$areyouin = isset($_POST['areyouin']) ? $_POST['areyouin'] : $_SESSION['areyouin'];
$user = isset($_POST['user']) ? $_POST['user'] : $_SESSION['user'];

if($areyouin != true){
echo "you are not in";
}
?>
it gives me the "welcome" but nothing else. I am testing it without storing anything to the sessions first, so shouldn't it tell me "you are not it" ??


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Jun 11, 2007 3:22 pm
by feyd
This would only, potentially, work if .html files are parsed as PHP.