Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2003-04-21, 07:56 AM
Junior Member
 
Join Date: Apr 2003
Posts: 1
sacfreak
Default

hi,
i have a common php page which initialises a few session variables. this is included in two other PHP pages. in one page i check the value of one particular variable. if it is one i do some processing.. in common i make it one (if it has not already being set). i use the new values of the other variables in the 2nd PHP page... but both scripts seem to break the
if (!isset()) in common and reinitialise variables everytime, thus causing problems in other PHP scripts....i have included important parts of Common.php and the 1st PHP file....Please help..as i cannot do without sessions...

session_start();
if (!isset($_SESSION["sessDetail"],$_SESSION["sessCartVis"],$_SESSION["sessVARS"]))
{
$_SESSION["sessAllItems"]="";
$_SESSION["sessAllCost"]="";
$_SESSION["sessVARS"]="";
//$sessCartIdx=1;
$_SESSION["sessDetail"]=1; //session that needs to be initalised
}

1st PHP page
include "common_classes1.php";
session_start();
setcon();

if ($_SESSION["sessDetail"]==1)
{
echo"SessDetail:- "; echo $_SESSION["sessDetail"]; echo"
";
$_SESSION["sessDetail"]=2; //this gets reinitialised to 1 $_SESSION["sessCategory"]=$_POST["sltCategory"];
$_SESSION["sessVARS"]=$HTTP_POST_VARS;
}
__________________
Bugs are an integral parts of huaman and Software evolution....
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2003-04-21, 12:30 PM
Junior Member
 
Join Date: Mar 2003
Location: austria
Posts: 18
glassJAw
Send a message via ICQ to glassJAw
Default

you should register session vars with session_register()

btw: isset() doesn't process multiple vars, afaik
__________________
my name is denver max and i eat heart attacks
Reply With Quote
  #3 (permalink)  
Old 2003-05-15, 02:08 AM
Guest
Guest
 
Posts: n/a
Default

session_register() is deprecated in favor of $_SESSION.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:13 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.