Answer the question
In order to leave comments, you need to log in
How to follow the link after uploading images?
How to follow the link after the file is successfully uploaded?
Here is the code, I insert
header('Location: https://site.ru/success.php');
the transition for some reason is not executed.
Here is the code in full
<?php
// если была произведена отправка формы
if(isset($_FILES['file'])) {
// проверяем, можно ли загружать изображение
$check = can_upload($_FILES['file']);
if($check === true){
// загружаем изображение на сервер
make_upload($_FILES['file']);
echo "<strong>Фотографии успешно загружены!</strong>";
header('Location: http://site.ru/success.php');
}
else{
// выводим сообщение об ошибке
echo "<strong>$check</strong>";
}
}
?>
Answer the question
In order to leave comments, you need to log in
You first send a text about the successful upload of photos, and then set the redirect header, but you can’t do that. Headers must be set before the first byte is sent.
take away
echo "<strong>Фотографии успешно загружены!</strong>";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question