Jump to content

Session variables problem


narjis

Recommended Posts

I am having probelm in saving Session variables ALthough I'm writing session_start();

in the header of my php script and saving the values of Session array in the next page. It does not print the values or show right results.

 

session_start(); 
require_once ("functions.php"); 

$token=$_GET['t'];
if(!isset($token)){

$name = stripslashes($_POST['username']);
$email = stripslashes($_POST['email']);

check_validate_input($name, $email);
}
if($token=='register')
{
show_registration_form();
}
  $my_model = new model();
  $arr_info = $my_model->check_members($name,$email);

   if (($arr_info==NULL)&&($token!='register'))
    {    
    echo '<p> Hello Guest</p><br />';
       show_mailing_form(); 
    }
    
  else if (($arr_info['role']=='user')||($arr_info['role'] == 'admin'))
    {
         $_SESSION['userId']=$arr_info['id'];
         $_SESSION['user_role']=$arr_info['role'];
         $_SESSION['user_name']=$arr_info['name'];
        print_r  ($_SESSION);}

here it does not print session array.

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.