Hello I have 2 pages in PHP, in the first one is my HTML-code on second page PHP for that html, just tried to write a checking for $_FILES(whether it is empty or not) to add a text(missing files or to process next action in backend), but the echo in my HTML doesn’t work, maybe smth is not right so pls just check the code and mention the issues if possible, thanks in advance.
Here is the HTML.php code
<div class = "col-lg-6" id = "error">
<span>
<?php echo $error; ?>// (this echo doesnt work)
</span>
</div>
and here is my PHP.php code
public function dashboard(){
$this->view('admin/dashboard');
$error = ""; //(to declare variable)
if($_FILES['file']['name'] == ''){
$error = "Please Upload The Picture";
}
//var_dump($_FILES);(no issues with connecting as var_dump works)
}