View Single Post
  #6 (permalink)  
Old 2004-02-03, 08:06 AM
zara zara is offline
Junior Member
 
Join Date: Feb 2004
Posts: 4
zara
Default

Yep. I think that's fine:

page1----------------------
if (session_is_open) {
...
} else {
do JavaScript
call page2 via form.submit
}

page2----------------------
write JS_Data_2_Database
open session
call page1

#############################
I prefer doing all stuff like this in one single file, but that's my personal point of view. Refering to my suggestion I mean:

pageN-------------------------

<?
# NO OUTPUT LIKE HTML, ECHO, etc. before this!
if (session_is_open) {
OUTPUT LIKE HTML, ECHO, etc. starts here
...
do whatever_you_want
...
} elseif (js_is_done) {
# NO OUTPUT LIKE HTML, ECHO, etc.
write JS_Data_2_Database
open session
call pageN
} elseif {
?>
JavaScript goes here...
call pageN via form.submit
<?
}
?>

by the way: consider using 'header("Location: page_xyz.php")' instead of 'document.location'.
What do you do, if your client hasn't activated JS?
In fact, I think the get_browser-command is much saver and will lead to the most accurate results...
beside this I think it's much easier then "our" approach.

bye, zara

you are german, aren't you? that's what I am...
Reply With Quote