olfrog Posted November 19, 2006 Share Posted November 19, 2006 we have one of thoseWarning: Cannot modify header information - headers already sent by (output started at /home/sites/himalayanlearning.org/public_html/sponsor-donation-form.php:40) in..problems on our donation webpage http://www.himalayanlearning.org/sponsor-donation-form.phpthat we cannot get rid of! we have [b]tried finding extra spaces, extra lines[/b] and so on, but it still won't leave and it's getting really annoying!could any kind soul help us by having a look at the page? the line that the above complaint is targeted is below and is <META NAME="Keywords" CONTENT="sponsor a child"><META NAME="Copyright" CONTENT="Himalayan Learning Registered Charity 1103105"><META NAME="Distribution" CONTENT="Global"><META NAME="Robots" CONTENT="all"><META http-equiv="Robots" content="index, follow">and doesn't have any php in it. we have looked for spaces at the top and at the bottom of the page. we use dreamweaver on a mac.the top of the php code is below,...................<?php include 'connections/db.php';session_start();$user = $_SESSION['id'];switch($_GET["action"]){case "add_item":{AddItem($_GET["id"], $_GET["qty"]);ShowCart();break;}case "update_item":{UpdateItem($_GET["id"], $_GET["qty"]);ShowCart();break;}case "remove_item":{RemoveItem($_GET["id"]);ShowCart();break;}default:{ShowCart();}}function AddItem($itemId, $qty){global $hostname_db, $username_db, $password_db, $database_db;$cxn = @ConnectToDb($hostname_db, $username_db, $password_db, $database_db);$result = mysql_query("select count(*) from cart where cookieId = '" . GetCartId() . "' and itemId = $itemId");$row = mysql_fetch_row($result);$numRows = $row[0];if($numRows == 0){@mysql_query("insert into cart(cookieId, itemId, qty) values('" . GetCartId() . "', $itemId, $qty)");}else{UpdateItem($itemId, $qty);}}function UpdateItem($itemId, $qty){global $hostname_db, $username_db, $password_db, $database_db;$cxn = @ConnectToDb($hostname_db, $username_db, $password_db, $database_db);if($qty == 0){RemoveItem($itemId);}else{mysql_query("update cart set qty = $qty where cookieId = '" . GetCartId() . "' and itemId = $itemId");}}function RemoveItem($itemId){global $hostname_db, $username_db, $password_db, $database_db;$cxn = @ConnectToDb($hostname_db, $username_db, $password_db, $database_db);mysql_query("delete from cart where cookieId = '" . GetCartId() . "' and itemId = $itemId");}function ShowCart(){global $hostname_db, $username_db, $password_db, $database_db;$cxn = @ConnectToDb($hostname_db, $username_db, $password_db, $database_db);$totalCost = 0;$delivery = 0; ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="EN"><head><Title>Himalayan Learning Form</title><META NAME="Author" CONTENT="Oliver Spencer-Shrestha"><META NAME="Description" CONTENT="sponsor a child for just £7 per year"><META NAME="Keywords" CONTENT="sponsor a child"><META NAME="Copyright" CONTENT="Himalayan Learning Registered Charity 1103105"><META NAME="Distribution" CONTENT="Global"><META NAME="Robots" CONTENT="all"><META http-equiv="Robots" content="index, follow">...................if anybody could help, that would be fantastic and would help us get more kids out of child labour quicker!thanksoliverhimalayan learning Quote Link to comment https://forums.phpfreaks.com/topic/27762-charity-needs-help-on-one-php-page-stubbornly-holding-our-website-back/ Share on other sites More sharing options...
redbullmarky Posted November 19, 2006 Share Posted November 19, 2006 check your connections/db.php for spaces, too. there should be NO whitespace before or after the <?php ?> tags in the db file.otherwise, take a look at [url=http://www.php.net/ob_start]ob_start[/url] Quote Link to comment https://forums.phpfreaks.com/topic/27762-charity-needs-help-on-one-php-page-stubbornly-holding-our-website-back/#findComment-127016 Share on other sites More sharing options...
olfrog Posted November 19, 2006 Author Share Posted November 19, 2006 hi,thanks very much, i have gone through the connect file and checked it for spaces, and have deleted the 3 i found that were inbetween code, however there was nothing before or after the <?php codes start and finish.regarding ob_start can i just clarify after reading it, this stops the problem being shown in the browser window, is that right? it's really just to cover up what is going on - which is finee, because it all works fine anyway!is that right?thanks in advanceoliver@ himalayan learning Quote Link to comment https://forums.phpfreaks.com/topic/27762-charity-needs-help-on-one-php-page-stubbornly-holding-our-website-back/#findComment-127076 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.