Jump to content

Sessions problem, plz. help


tomkure

Recommended Posts

Hi,

 

Never use sessions to stores values, but don't looks difficult, anyway....

 

Need to store which page I am comming from as a number

 

On page 1

 

session_start();

$pageID=4;

$_session['var99'] = $pageID ;

echo $_session['var99']; ***Give value 4***

 

On page 2

 

session_start();

echo $_session['var99']; *** Gives me nothing ***

if ($_session["var99"] <> '' ){

  $back = $_session["var99"];

}

 

Is there something wrong in my code

 

Kind Regards

Tom

 

 

Link to comment
https://forums.phpfreaks.com/topic/191128-sessions-problem-plz-help/
Share on other sites

$_session is just the name of an array variable on the current page. $_SESSION is the name of variables that are part of a session.

 

In programming, just about everything has significance because computers only do exactly what their programs tell them to do.

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.