session variable problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
venkylingutla
Forum Newbie
Posts: 5
Joined: Fri Jan 29, 2010 4:39 am

session variable problem

Post 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.
kushaljutta
Forum Commoner
Posts: 50
Joined: Fri Dec 26, 2008 11:05 am

Re: session variable problem

Post 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
venkylingutla
Forum Newbie
Posts: 5
Joined: Fri Jan 29, 2010 4:39 am

Re: session variable problem

Post 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.
staar2
Forum Commoner
Posts: 83
Joined: Fri Apr 06, 2007 2:57 am

Re: session variable problem

Post by staar2 »

what kind of errors or warnings you get ? Or just gives undefined var error ?
venkylingutla
Forum Newbie
Posts: 5
Joined: Fri Jan 29, 2010 4:39 am

Re: session variable problem

Post 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
Post Reply