Re: selfreferencing script with output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/23/05, Sabine <phpdev@xxxxxxx> 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.

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.

>
> Thanks in advance for your answers
> Sabine
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux