Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.