There is a code that does not work. The class works correctly, the problem is only in the function header ();
<?php include '../../classes/Band.php'; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ session_start(); $error = false; if(isset($_POST['name']) && !empty($_POST['submit'])){ $name = $_POST['name']; $band = new Band($name); if(isset($_FILES['band_img']['name'])){ $img = $_FILES['band_img']; $_SESSION['error'] = $band->addBand($img); if (!empty($_SESSION['error'])){ $error = true; } }else{ $_SESSION['error'] = 'Фаил не выбран'; $error = true; } }else{ $_SESSION['error'] = 'Введите название альбома'; $error = true; } if ($error === true){ header("Location: ../admin_templates/admin_template.php?s=0"); }else{ header("Location: ../admin_templates/admin_template.php?s=1"); } ?> Question:
How in this case to implement transitions to other pages (templates) depending on the value of the flag? Thanks in advance for your help.
..for starters, you see, and earn. - teran