Re: selfreferencing script with output

From: Date: Sat, 24 Sep 2005 09:40:04 +0000
Subject: Re: selfreferencing script with output
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-223115@lists.php.net to get a copy of this message
Thank you very much for your answer, Rory, but I fear I don't understand the most important parts of it. It would be very nice of you if you could give me a further hint, more explanation. Rory Browne schrieb:
On 9/23/05, Sabine <phpdev@sric.de> wrote:
Hello to all, I have 2 scripts ( preparing about 1000 mails for pear's mail-queue and sending them) which shall be started by the user. There are - limitations of the provider for the duration of the scripts - no cronjobs So I had the idea to write a selfreferencing script like that: $begin= intval($_GET["begin"]); $allMails = 1000; //... prepare / send a portion of for example 50 mails if (($begin+ 50) < $allMails) { header("Location: script.php?begin=".($begin+ 50)); } else { echo "Done!"; } But I want to show the user some output like a statusbar (eventually with pear's Html_Progress) or something like that so he knows the script is still working.
instead of simply headering the location out, you could simply output a html page, that has a meta tag to replace it. What do you mean with that meta tag?
maybe something like <html/head/meta tag here> <body> <?php $full_width = 200; $amt_sent = $_GET['begin'] + 50; $amt_to_send = 1000; $img_width = ceil($amt_sent * $full_width / $amt_to_send); ?> <img src="pixel.php" height="20" width="<?php echo $img_width; ?>"> <?php flush(); send_the_mails(); ?>
Has anybody of you an idea, a tip for me how to do it? I don't see how I can do it within the construct above. Is there an alternative to it?
This doesn't necessarly need to be done using a self-referencing script. You could have an ajax type system where each script is accessed sequentially.
And what is an ajax type system? I'm not sure if I don't understand what you mean due to my lack of english speaking capabilities or if I don't know the concept. I assume the last. But additionaly I don't find the word "ajax" in my dictionaries or at leo's. Is it an abbreviation? Kind regards Sabine

« previous php.general (#223115) next »