tags:

views:

102

answers:

3

The following syntax is incorrect:

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

What is the correct syntax?

+9  A: 

You probably want this:

$_SESSION['page'.$numberpages] = $CurrentPage;
Gumbo
+4  A: 
 $_SESSION['page' . $numberpages] = $CurrentPage;
Darryl Hein
+10  A: 

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.

Ionuț G. Stan