2

The following syntax is incorrect:

$_session['page'$numberpages]=$CurrentPage;

What is the correct syntax?

3 Answers 3

12

You probably want this:

$_SESSION['page'.$numberpages] = $CurrentPage;
Sign up to request clarification or add additional context in comments.

Comments

11

You're missing a dot, a concatenation dot:

$_SESSION['page' . $numberpages]=$CurrentPage;

Or use double quotes:

$_SESSION["page$numberpages"]=$CurrentPage;

And, variable names are case-sensitive in PHP, unlike function names. So, it should be $_SESSION, instead of $_session.

Comments

5
 $_SESSION['page' . $numberpages] = $CurrentPage;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.