Hi,
My question is how do i reload a php page after a job has been done.
Fore example my script does :
work 1
work 2
and after work 2 is finished i would like to reload the same xy.php page.
Can it be done ?
Cheers and Thanks!
Printable View
Hi,
My question is how do i reload a php page after a job has been done.
Fore example my script does :
work 1
work 2
and after work 2 is finished i would like to reload the same xy.php page.
Can it be done ?
Cheers and Thanks!
Hello
here is a simple way:
regards :)PHP Code:<?php
if ($_GET['job'] != 'done') {
// work 1
// work 2
header('Location: xy.php?job=done');
exit();
} else {
// do another thing
}
?>
Feras Jobeir
thank you very much!
i will try the code now ... :)
EDIT:
this is what i have :
echo "<textarea rows=20 cols=40>" . $messageToShow."</textarea>";
die("Elaborated.");
$stop++;
header('Location: cronindex.php?');
exit();
But this seems not to work...maybe i did something wrong?
hello
- In my example, to know that we have done work1 and work2, I have passed a variable (job) with the value (done), in the URL.
- when you reload the page, all variable will be (cleaned from memory), you have to pass them via URL, store them in a session or database or any other way to work with them later
regards :)
Feras Jobeir
Is there a way to just reload the page ...
I have read that header function will not work is a text has been echoed before ....
Im really having trouble making this work .... :(
Hello
so, instead of using header, try meta refresh like this
but it may be disabled, so try another way using javascript:PHP Code:echo '<meta http-equiv="refresh" content="0; URL=xy.php?job=done" />';
regards :)PHP Code:echo '<script type="text/javascript">window.location="xy.php?job=done"</script>';
Feras Jobeir