for(i = 0; i < document.forms.length; i++)
{
with(document.forms[i])
{
action = addvar(action, 'SID', '<? echo $SID; ?>');
}
}
[/code]
the function above, searches all links and actions in a page, and adds an extra variable to the URL-string, in order to pass a session-ID to the next page.

I don't know the new session-possibilities in PHP4, but in PHP3, you can add a variable to each link while building the page.

What i would do:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
// at the top of the page
$SID = some_function_or_var_that_passes_SID();

okay, in that case the only thing you have to change is:
* let PHP generate your page, which is almost completely static, except for 1 thing: at the top do something like this:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
echo "<HTML>n"; // and all the other header-stuff
echo "<SCRIPT LANGUAGE="Javascript"">n";
echo " var SID=" . $SID . ";n"; // $SID should be available somewhere in your PHP-code
// and below the rest of the html/javascript-code that you showed in the upper message
[/code]