Total members 11895 |It is currently Tue Dec 03, 2024 7:28 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi,
I have developed a small application for my company on PHP but have some small difficulty to overcome. In fact some session variables are getting vanished mysteriously.
Here is the flow :

index.php->page1.php->page2.php->page3.php

Here are the excerpts from the files.

index.php :
Code:

session_start
();
session_register("username_session");
session_register("fullname_session");
$_SESSION["username_session"]=<value from database>
$_SESSION["fullname_session"]=<value from database


page1.php :

Nothing related to session or session variables in this page. Just pass on a few form fields to next page.
The form fields are "firstvar" and "secondvar"

page2.php :
Code:

session_start
();
session_register("firstvar_session");
session_register("secondvar_session");

$_SESSION["firstvar_session"]=$_POST["firstvar"]
$_SESSION["secondvar_session"]=$_POST["secondar"]

 

page3.php:

I access session variables here
Code:

session_start
();
echo 
"username=".$_SESSION["username_session"]."<BR>";
echo 
"fullname=".$_SESSION["fullname_session"]."<BR>";
echo 
"firstvar=".$_SESSION["firstvar_session"]."<BR>";
echo 
"secondvar=".$_SESSION["secondvar_session"]."<BR>";


 

Here is the output :
Quote:
username=ganesh
fullname=M. Ganesh
firstvar=
secondvar=





Author:
Newbie
User avatar Posts: 23
Have thanks: 1 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : PHP session variables problem in Firefox
 PHP session variables     -  
 Modify Session Variables     -  
 declaring variables problem     -  
 Local variables vs Instance variables     -  
 ScrollableTable is not working in the firefox     -  
 how to disable JavaScript in Mozilla FireFox     -  
 How to create a file in java script using FireFox     -  
 $.browser Check if your browser is IE or FireFox or Chrome     -  
 session in jsp     -  
 PHP Variables     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com