Page 1 of 1
session variable problem
Posted: Fri Jan 29, 2010 5:17 am
by venkylingutla
session variable is working fine in IE but it is not working in Fire fox and chrome browsers.i am getting null value in this browsers.please help me to resolve this prob.
Re: session variable problem
Posted: Fri Jan 29, 2010 5:28 am
by kushaljutta
Can you send me your code, so I can try to resolve your problem,
use session_register('session name'); for registering the session variables
Kushal Jutta
Re: session variable problem
Posted: Fri Jan 29, 2010 5:39 am
by venkylingutla
here is the code
require_once('./utils.php');
if(!isset($_SESSION['timestamp_logo_path']))
{
$_SESSION['timestamp_logo_path'] = BASENAME_TIME;
}
$tempFile = $_FILES['Filedata']['tmp_name'];
$fileName = $_FILES['Filedata']['name'];
$fileSize = $_FILES['Filedata']['size'];
$ext=substr($fileName, strrpos($fileName, '.') + 1);
if(($ext=='jpg')||($ext=='jpeg')||($ext=='png') )
{
$path="ProfileImages/";
$uploadfilePath=$path.$_SESSION['timestamp_logo_path']."_".$fileName;
}
else{
$path="Files/Artifact/";
$fileext="A_".$fileName;
$uploadfilePath=$path.$fileext;
$file_var.=$fileext."@";
}
move_uploaded_file($tempFile,$uploadfilePath);
//The session variable $_SESSION['timestamp_logo_path'] i am using in some other page.
it is working fine in IE but it is not working in Firefox browser.
Re: session variable problem
Posted: Fri Jan 29, 2010 6:21 am
by staar2
what kind of errors or warnings you get ? Or just gives undefined var error ?
Re: session variable problem
Posted: Fri Jan 29, 2010 6:42 am
by venkylingutla
i am not getting errors .. i am not able to get the variable value.it is just giving me null value in firefox but it is giving me the value in IE