PDA

View Full Version : Redirecting Help Needed


AnkisethGallant
09-21-2002, 06:53 PM
I've got a script that does a query. However, the query takes too long (over the 30 second limit). I have it working as a while command, but I know it's possible to split it up. I want to redirect it, but keep some of the variables. How do I do this? I don't need to redirect if I can at least refresh it.

TECK
09-22-2002, 12:48 AM
you have to tell us more about what you are trying to do. if you simply want to refresh, you want to do it only once, or at regular intervals?

go ahead explain in details.

Issvar
09-22-2002, 01:29 AM
Something like this:
<?php
if ($x=='') { $x=0; }
$y=$x+1000;
while ($x<$y) {
// do your stuff
$x++;
}
echo '<html><body>You got to: '.$x.'<script>location.href="'.$HTTP_SERVER_VARS['PHP_SELF'].'?x='.$x.'"; </script></body></html>';
?>

AnkisethGallant
09-22-2002, 07:36 PM
That still does a query without refreshing the script, so it's really pointless Issvar.

I figured it out. After the loop, it would load an auto-refresh page with the url including all of the actions (i.e., index.php?action=this&variable=that). Then it would go back to the action and do it again until the loop was finished.