I searched for this but couldn't find a definitive answer:
Are session variables available immediately?
For example, if I have
<head>
<script type="text/javascript">
var stopvalue = <? PHP echo $SESSION['maxrows'] ?>;
function validate() {
for (x=0; x<stopvalue, x++) {
// do something
}
}
</script>
</head>
and then, in the <body> on the same page have
$SESSION['maxrows']=db->Recordcount();
Will 'maxrows' be visible to the 'validate' function or not?
Thanks, everyone on this forum has been very helpful to this PHP beginner.
I know I could just try it and see if it works, but I don't want to go down the path of develping an entire page only to find it won't work (and if it won't work, what's a good alternative?)