[KLUG Members] session variables
Lunitix
lunitix at earthlink.net
Sun Dec 5 21:54:30 EST 2004
Sorry I wasn't completely correct in my example. I didn't quite state
what I am trying to do. I have made a change with a note at the bottom
of the example.
Lunitix wrote:
> Is there a way to place a variable within a variable in php.
>
> ie
>
> page1
>
> session_start();
> $_SESSION['var1']= "0";
> $_SESSION['var2']= "0";
> $_SESSION['var3']= "0";
> ...etc...
> link to page2
>
>
> page2
>
> if ($var1 == 0) {
> echo "image1 with link to page3";
> } else
> echo "imageblank";
>
> if ($var2 == 0) {
> echo "image2 with link to page3";
> } else
> echo "imageblank";
>
> if ($var3 == 0) {
> echo "image3 with link to page3";
> } else
> echo "imageblank";
>
>
> page3
>
> if ($istrue)
> return to page2
> else
> link-to-make-query-true-and-reload-page;$_SESSION['here is where the
session_variable needs to be variable based on the link from page2']++;
Where the "$_SESSION[variable to be named] ++;" I would like the
variable to be named to be one of "$var"s from the previous page.
ie
if you select the first link the $_SESSION variable on the third page
would increase the "$_SESSION[var1]" by one which in turn leads to a
blank image and no link where the first link existed.
I don't know if I'm making any sense here or not, but I know I wasn;t
clear enough the first time around.
Jon
Minding of Madness
More information about the Members
mailing list