tribalmaniac
11-07-2006, 05:25 PM
I have a php script whereby the user inputs their information and it gets submitted to the database.
when it is submitted, I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/.mala/tribalmaniac/theflashplace.com/top.php:16) in /home/.mala/tribalmaniac/theflashplace.com/myprofile.php on line 979
top.php is this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="mainStyle.css" />
<title>.:: The Flash Place ::.</title>
<link rel="stylesheet" type="text/css" href="mainstylesheet.css" />
<SCRIPT LANGUAGE="JavaScript">
extensionArray = new Array(".jpg", ".png", ".gif");
function LimitAttachImage(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extensionArray.length; i++) {
if (extensionArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Sorry, that file type is not allowed");
}
</script>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "specific_textareas",
editor_selector : "tinyMCE",
theme : "advanced",
plugins : "spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,z oom,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%d/%m/%Y",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js",
force_br_newlines : "true",
content_css : "style/content.css",
theme_advanced_resize_horizontal : false,
theme_advanced_resizing : true,
// file_browser_callback : "mcFileManager.filebrowserCallBack",
convert_urls : false,
dialog_type : "modal"
});
</script>
</head>
<body>
<div id="main">
<div id="banner">
<img src="header.png" width="784" height="138" />
</div>
<div id="content">
<div id="navpos">
<p class="navtext">
<?php
include("connection.php");
putenv("TZ=Europe/London");
session_start();
$id = $_SESSION['id'];
$anynew = mysql_query("SELECT * FROM `message` WHERE `touser` = '$id' AND `read` = 0");
$anynew_rows = mysql_num_rows($anynew);
if(empty($_SESSION['id'])) {
echo('<A HREF="index2.php">Home</A> | <A HREF="news.php">News</A> | <A HREF="tutorials.php">Tutorials</A> | <A HREF="forum.php">Forum</A> | <A HREF="gallery.php">Gallery</A> | <A HREF="myprofile.php">My Profile</A> | <A HREF="messages.php">My Messages</A> | <A HREF="register.php">Register</A>');
}
else if(isset($_SESSION['id']))
{
echo('<A HREF="index2.php">Home</A> | <A HREF="news.php">News</A> | <A HREF="tutorials.php">Tutorials</A> | <A HREF="forum.php">Forum</A> | <A HREF="gallery.php">Gallery</A> | <A HREF="myprofile.php">My Profile</A> | <A HREF="messages.php">My Messages ('.$anynew_rows.' new)</A> | <A HREF="logout.php">Log Out</A>');
}
?>
</p>
</div>
I've been told this problem is caused by whitespace, but i cant see where ive gone wrong?
when it is submitted, I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/.mala/tribalmaniac/theflashplace.com/top.php:16) in /home/.mala/tribalmaniac/theflashplace.com/myprofile.php on line 979
top.php is this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="mainStyle.css" />
<title>.:: The Flash Place ::.</title>
<link rel="stylesheet" type="text/css" href="mainstylesheet.css" />
<SCRIPT LANGUAGE="JavaScript">
extensionArray = new Array(".jpg", ".png", ".gif");
function LimitAttachImage(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extensionArray.length; i++) {
if (extensionArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Sorry, that file type is not allowed");
}
</script>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "specific_textareas",
editor_selector : "tinyMCE",
theme : "advanced",
plugins : "spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,z oom,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%d/%m/%Y",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js",
force_br_newlines : "true",
content_css : "style/content.css",
theme_advanced_resize_horizontal : false,
theme_advanced_resizing : true,
// file_browser_callback : "mcFileManager.filebrowserCallBack",
convert_urls : false,
dialog_type : "modal"
});
</script>
</head>
<body>
<div id="main">
<div id="banner">
<img src="header.png" width="784" height="138" />
</div>
<div id="content">
<div id="navpos">
<p class="navtext">
<?php
include("connection.php");
putenv("TZ=Europe/London");
session_start();
$id = $_SESSION['id'];
$anynew = mysql_query("SELECT * FROM `message` WHERE `touser` = '$id' AND `read` = 0");
$anynew_rows = mysql_num_rows($anynew);
if(empty($_SESSION['id'])) {
echo('<A HREF="index2.php">Home</A> | <A HREF="news.php">News</A> | <A HREF="tutorials.php">Tutorials</A> | <A HREF="forum.php">Forum</A> | <A HREF="gallery.php">Gallery</A> | <A HREF="myprofile.php">My Profile</A> | <A HREF="messages.php">My Messages</A> | <A HREF="register.php">Register</A>');
}
else if(isset($_SESSION['id']))
{
echo('<A HREF="index2.php">Home</A> | <A HREF="news.php">News</A> | <A HREF="tutorials.php">Tutorials</A> | <A HREF="forum.php">Forum</A> | <A HREF="gallery.php">Gallery</A> | <A HREF="myprofile.php">My Profile</A> | <A HREF="messages.php">My Messages ('.$anynew_rows.' new)</A> | <A HREF="logout.php">Log Out</A>');
}
?>
</p>
</div>
I've been told this problem is caused by whitespace, but i cant see where ive gone wrong?