I have read everything I could find and still haven't found the proper syntax or location in the page. The article on using session variables was a great help but I am still lost. Any help including sample code really apprecliated.
Page 1 has a list of links that call page 2.
On page 1 I have a form checkbox without a submit button.
If the checkbox is checked I need to save the status and pass it to page 2 whenever a link is called so I want to set the session variables to make the checkbox status global.
I need a function that will set the session variable and where the function is placed in the page ( before the <html> in the <head>?)
Don't know how to define the function but this is what I want to accomplish ?
function set_my_session_var
session_start();
if checkbox==checked then
$my_session_checkbox = "1";
else
$my_session_checkbox = "0";
endif
session_register("my_session_checkbox");
endfunction
In the checkbox onclick="set_my_session_var" to set the session variable.
On page 2 where do I place the php session start code?
Proposed code:
<?php
session_start();
?>
<body>
Below is what I want to accomplish
if 1 == $mysession_checkbox
do process1;
else
do process2;
endif
Any help with the proper php syntax and placement on the page will be appreciated.
Bert