Using IE 7, I get a "Headers Already Sent Error" Even after having checked for all the usual suspects:
1) preceeding output/lines/blank spaces, no blank lines/spaces after my php block in an included file,
2) no BOM set (in Adobe Dreamweaver),
3) no virtual includes, session starts, cookies (header sending functions)
I have two stripped down simple test files: MM_Output2.php and MM_GetImage.php.
MM_Output2.php, some standard HTML and 3 php lines:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MyTest</title>
<body>
<?php
include("MM_GetImage.php");
?>
</body>
</html>
And MM_GetImage.php, again 3 lines only!:
<?php
header("Location: MM_Output2.php");
?>
Any expert ideas why I would be getting a Header already sent message? :wtf:
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\MM_Output2.php:7) in C:\AppServ\www\MM_GetImage.php on line 2
Interestingly, if I place the header redirect line BEFORE the PHP code block in the second file, my code works fine with NO header error. But oddly it then outputs the text: header("Location: MM_Output2.php"); to the top of the page! Why is that? :o
In brief, I want to use my MM_Output2 file to display a graphic with Next/Previous Submit Form buttons below it. That calls MM_GetImage to determine the name/location of the new image to display and sends that variable back to MM_Output2. Basically allowing a user to scroll through a set of images.
I've spent hours playing with this and reading the same "things to look for..." on 15 different websites...and still no success. Please save this sinner from software purgatory :-\
Thank you!!!