Good day! I make a site. On one page I made a redirect to another page using header. I get a warning:
Warning: Cannot modify header information - headers already sent by (output started at S:\home\localhost\www\web_shop\admin_header.php:97) in S:\home\localhost\www\web_shop\add_good.php on line 71 In the admin_header.php file, I have the following code fragment (I quote code from 96 lines):
<ul> <?php $result = List_categories(""); while ($row = $result->fetch_assoc()) { echo '<li><a href="admin.php?cat='.$row['id_cat'].'">'.$row['Name_cat'].'</a></li>'; } ?> </ul> And in the file add_good.php on line 71 the following code begins:
header("http://localhost/web_shop/admin.php"); exit(); The structure of the site is as follows: The config file (in which the session opens on the first line) connects to admin_header.php. The last file in turn connects to the admin.php and add_good .php files. What am I doing wrong? Where is the mistake?