Forum Moderators: coopster
I get the classical:
Warning: Cannot modify header information - headers already sent by (output started at /wn/show_item_list.php:6) in /wn/scripts/db2.php on line 25
my code is as follows:
for - show_item_list.php -
<?php include("db2.php");?>
<html>
<head>
<title>Order Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.boxes {...
....
...html stuff
for - db2.php -
<?php
// This page contains the connection routine for the
// database as well as getting the ID of the cart, etc
session_start();
$connection=mysql_connect("host", "dbuser", "dbpass")
or die(mysql_error());
mysql_select_db("DB", $connection);
function GetCartId()
{
// This function will generate an encrypted string and
// will set it as a cookie using set_cookie. This will
// also be used as the cookieId field in the cart table
if(isset($_COOKIE["CartID"]))
{
return $_COOKIE["CartID"];
}
else
{
// There is no cookie set. We will set the cookie
// and return the value of the users session ID
setcookie("CartID", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
}
?>
The db2.php is at the top of the show_item_list.php - so I do not send anything (html code, or echo's ) to the browser - Im new so I might have missed something?
Thanks,