fixed realtime echo output display
This commit is contained in:
49
handle.php
Normal file
49
handle.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// Wenn WordPress nicht geladen ist, einbinden:
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
require_once dirname(__FILE__) . '/../../../wp-load.php';
|
||||
}
|
||||
|
||||
// Deaktiviere eventuelle Output-Kompression und aktiviere implizites Flushen:
|
||||
@ini_set('zlib.output_compression', 0);
|
||||
@ini_set('implicit_flush', 1);
|
||||
while (ob_get_level()) {
|
||||
ob_end_flush();
|
||||
}
|
||||
ob_implicit_flush(1);
|
||||
|
||||
// Sende Header, um weiteres Buffering zu verhindern:
|
||||
header("Content-Encoding: none");
|
||||
header("X-Accel-Buffering: no");
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
// Zeitlimit erhöhen (optional)
|
||||
set_time_limit(0);
|
||||
|
||||
if ( ! isset( $_GET['ids'] ) || empty( $_GET['ids'] ) ) {
|
||||
echo "Keine IDs übermittelt.";
|
||||
exit;
|
||||
}
|
||||
|
||||
$ids = $_GET['ids'];
|
||||
|
||||
// Sofortige Ausgabe:
|
||||
echo "<p><strong>IDs (sofort):</strong> " . htmlspecialchars( $ids ) . "</p>";
|
||||
|
||||
// Sende genügend Padding, um den Output-Buffer zu füllen:
|
||||
echo str_repeat(" ", 4096);
|
||||
flush();
|
||||
if (function_exists('ob_flush')) {
|
||||
ob_flush();
|
||||
}
|
||||
|
||||
// 2 Sekunden warten:
|
||||
sleep(2);
|
||||
|
||||
// Ausgabe nach 2 Sekunden Verzögerung:
|
||||
echo "<p><strong>IDs (nach 2 Sekunden Verzögerung):</strong> " . htmlspecialchars( $ids ) . "</p>";
|
||||
flush();
|
||||
if (function_exists('ob_flush')) {
|
||||
ob_flush();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user