<!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=iso-8859-1" />
<title>Add a Product</title>
</head>
<body>
<?php
session_start();
require_once('mysql_connect.php');
if(isset($_POST['submitted'])){
if(!empty($POST['product_name'])){
$pn = escape_data($POST['product_name']);
}
else
{
$pn = FALSE;
echo '<p><font color="red">please enter the product\'s name! <font>
</p>';
}
//image code left on page 588
//check for price
if(is_numeric($POST['price'])) {
$p = (float) $POST['price'];
}
else{
$p = FALSE;
echo '<p><font color = "red">please enter the product\'s price!</font></p>';
//check for description (not required)
if(!empty($POST['description'])){
$d = escape-data($POST['description']);
}
else{
$d = '<i> No description available. </i>';
}
}
if($pn && $p){
$query = "INSERT INTO product(product_name, price, description)
VALUES ('$pn', '$p', '$d')";
if($result = mysql_query($dbc, $query)){
echo '<p> The product has been added.</p>';
}
else{
echo '<p><font color = "red"> Your submission could not be processed due to a system error.</font></p>';
}
}
else{
echo'<p><font color="red">please click "back" and try again .</font></p>';
}
}
// Display the form.
?>
<form enctype="multipart/form-data" action="add_print.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="524288"/>
<fieldset>
<legend>Fill out the form to add a product to the catalog: </legend>
<p><b>Product Name: </b> <input type="text" name="product_name" size="30" maxlength="60"/></p>
<p><b>Price: </b><input type="text" name="price" size="10" maxlength="10"/> <small>Do not include dolloar sign or commas.</small></p>
<p><b>Description:</b>
<textarea name="description" cols="40" rows="5"></textarea>
</p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit"/></div>
<input type="hidden" name="submitted" value="TRUE"/>
</form>
<?php
}
?>
</body>
</html>
and i'm reciving this error still plz help me
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/www/pizzanuova.freehostia.com/add1.php:9) in /home/www/pizzanuova.freehostia.com/add1.php on line 10
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/pizzanuova.freehostia.com/add1.php:9) in /home/www/pizzanuova.freehostia.com/add1.php on line 10