Page 1 of 1
need help on executing program
Posted: Mon Jun 28, 2004 12:18 am
by bugthefixer
my site has a page which contains java applet
now i want to execute a program whenever this page is loaded and stop the program when page exits.
the program will be infact a php code which will create a table and after every 5 sec it will update the table..
any1 can tell me how it can be done
Posted: Mon Jun 28, 2004 12:31 am
by feyd
why not just have the page be this program, and set the page to refresh itself every 5 seconds?
Posted: Mon Jun 28, 2004 1:06 am
by bugthefixer
well thanx feyd
but in this way my applet will be also refreshed and i dont want to do that..
Posted: Mon Jun 28, 2004 1:54 am
by feyd
Does your server allow mid-script echos to print before the page is finished processing? Do you want to replace the table printed, or do you mind having many tables printed? Do you mind some (possible) browser incompatiblity for this?
if yes to the first question and yes to the first part of the second question:
You can use Javascript to replace the table that you output for each pass of the loop you'll create.
if yes to the first question and no to the second part of the second question:
You can output a new table every 5 seconds then.
For the two solutions I just gave, in my experiments with things like this, PHP often didn't acknowledge that I canceled the page, or navigated away, so beware.
if no to the last question:
You can use an iframe or frames to load this "program" page. Add a refresh and it takes care of user navigating away problem of the above solutions.
Posted: Mon Jun 28, 2004 3:49 am
by bugthefixer
well the usage of frames u hav suggested sounds good to me..but can u tell me how can i refresh this frame after every 5 secs..i mean thru some sort of code
Posted: Mon Jun 28, 2004 5:01 am
by feyd
stick the following in the header section of the framed html
Code: Select all
<meta http-equiv="refresh" content="5">