Отменить заголовок (обновить)

Можно ли отменить это после вызова:

<?php
// Start output while creating profile
if (ob_get_level() == 0) ob_start();

for ($i = 0; $i<1; $i++)
{
// Redirect user and download the profile
header('Refresh: .02; download.php');
echo "You're profile is being created, please wait...";

ob_flush();
flush();
sleep(1);
}

ob_end_flush();

// Start creating the profile
// Start this after the code above due to the long execution time
if(!createProfile())
{
// If createProfile returns false, cancel redirect and stop execution
cancelRedirect();
// Inform the user about the problem
echo 'Error!';
exit;
}
?>

Предполагается, что header()-функция вызывается, тогда скрипт что-то делает, и если результат не соответствует ожидаемому, перенаправление на «download.php» должно быть отменено.

0

Решение

Это невозможно, но возможно обратное:

<?php
if (doSomething()) {
header('Refresh: 1; download.php');
}
?>
0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector