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
https://forums.phpfreaks.com/topic/231720-session-variables-problem/
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.