Answer the question
In order to leave comments, you need to log in
How to solve the header problem?
You need to give the code in the 404 header instead of 200.
The code that should set the 404 is:
if($this->group_id == -1)
{
//header("HTTP/1.1 404 Not Found", true, 404);
header("HTTP/1.1 404 Not Found");
ToolkitLib::ShowError("Ошибка. Выбрана несуществующая группа.");
return false;
}
Answer the question
In order to leave comments, you need to log in
The header can only be changed if you haven't started uploading data yet.
Solutions to the problem:
<?php
...
if($this->group_id == -1) { ?>
<script> window.alert('Ошибка. Выбрана несуществующая группа'); windows.location.replace('/404'); </script>
<?php }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question