Browser disconnect.



  • Good evening. Maybe someone's gonna recommend a code for browser scrip. So, I did the request and forgot to be in the task, like a demon. And most importantly, to be able to stop it is also destined for the browser. ♪ ♪ Thank you so much.

    UPD: I've got a little snatch, I'm gonna start an eternity browser squeaking, and I'm gonna close the file. stop.txt And if he shows up, the violette stops the job, and the file itself is created by another violin, for example, under the name of the name. stop.php♪ Do you think this is possible?



  • Here's my bike!

    <?
    @ob_end_clean(); // чистим, если буфер включен
    @ob_implicit_flush(1); // отключаем буфер
    @ignore_user_abort(1); // не обрываем работу скрипта при обрыве соединения
    @set_time_limit(0); // убираем лимит времени
    if (!isset($_GET['key']) || ($_GET['key'] != '1234567890')) { // секретный код:)
      require 'textpage.php'; // страничка со ссылками
      exit;
      }
    if (isset($_GET['stop'])) { // ссылка остановки: script.php?stop
      file_put_contents('break.txt', '1');
      header('Loaction: ?');
      exit;
      }
    $i = 0;
    $stoptime = time()+600; // 10 мин, поставите 0 - без ограничений.
    // echo str_repeat(chr(0), 4096); // только для теста (в некоторых браузерах страница начинает показываться после "первых символов")
    while(true) {
      echo ++$i.' ';
      @flush(); // на всякий случай, отсылаем буфер
      usleep(100000);
      if (($stoptime > 0) && (time() > $stoptime)) break;
      if (is_file('break.txt')) { unlink('break.txt'); break; }
      }
    

    ?>

    The example just takes out the numbers as long as you tell him.

    I'd like to point out, nowhere but IE, I can't cut off the compound without finishing the violin, so I don't write about it. Option 2: Or launch the violin itself through fsockopen Without waiting for the content of the content(1) to send, for example, or bluntly in the browser to press "stop."


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2