Jump to content

session variables.


Recommended Posts

Hi all, I need a little help Im attempting to put in a loging status on my pages, I am using server behaviors in dreamweaver.. and I am new, very new. So I was very ecstatic when I got it to work but now I cant put it in the tables. I tried moving,

echo "Welcome ". $_SESSION['MM_Username'] ."!
YOU ARE CURRENTLY LOGGED IN!<br /><br />";

to the cell where I want it. by clicking on the cell,going to code view and pasting it there. I get nothing. I know its something simple like a " or something.. Im new at this so I am not even close to claiming I know what I am doing..thanks, I attached what is currently on the page so you can see what I have now, that works it just puts it above the header..
Text
Attach Code

<?php require_once('../Connections/jobs.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);

$logoutGoTo = "thankyou.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
echo "Welcome ". $_SESSION['MM_Username'] ."!
YOU ARE CURRENTLY LOGGED IN!<br /><br />";

Any ideas? Thanks, Michelle
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.