I get this error:
Warning: Cannot add header information - headers already sent by (output started at /home/blasto333/phppointofsale.com/html/PHP_Point_Of_Sale_7.0/sales/delete.php:9) in /home/blasto333/phppointofsale.com/html/PHP_Point_Of_Sale_7.0/sales/delete.php on line 73
This is happening because of calling header (“location: sale_ui.php”);
after the portion of the document, but I need to redirect to there. I only get an error on PHP 4.1.2 but not on my install of 4.3.4. Any suggestions? [code below]
[code]
<?php session_start(); ?> <?php /* Program: PHP Point Of Sale Author: Chris Muench Last Updated: Feburary 21, 2004 File: sales/delete.phpDescription:
*/
include ("…/settings.php");
include ("…/classes/db_functions.php");
include ("…/classes/security_functions.php");
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme);
$sec=new security_functions($dbf,‘Sales Clerk’);
if(!$sec->isLoggedIn())
{
header (“location: …/login.php”);
exit();
}
if(isset($_GET[‘action’]))
{
$action=$_GET[‘action’];
switch($action)
{
case $action==‘all’:
$sec->closeSale();
break;
case $action==‘item’:
$pos=$_GET[‘pos’];
for($k=0;$k<count($_SESSION['items_in_sale']);$k++)
{
if($k==$pos)
{
unset($_SESSION['items_in_sale'][$k]);
$_SESSION['items_in_sale']=array_values($_SESSION['items_in_sale']);
if(count($_SESSION['items_in_sale'])==0)
{
$sec->closeSale();
}
break;
}
}
break;
case $action=='item_search':
unset($_SESSION['current_item_search']);
break;
case $action=='customer_search':
unset($_SESSION['current_customer_search']);
break;
}
}
header (“location: sale_ui.php”);
$dbf->closeDBlink();
?>
[/code]