Hi ppl!
I am making a website for someone, and a shopping cart has already been placed in this website, however it is mal-functioning and I don’t seem to be able to figure out why.
When you click on a particular product this is the code which it enters:
index/shop/carrinho/asp/addencomenda.php?produto=AUTO-CURA - &preco=15.47
along with the http address.
It gives me the following error:
Warning: Cannot send session cookie - headers already sent by (output started at /home/sites/site57/web/index/shop/carrinho/asp/abrirconexaoaux.php:25) in /home/sites/site57/web/index/shop/carrinho/asp/addencomenda.php on line 35Warning: Cannot send session cache limiter - headers already sent (output started at /home/sites/site57/web/index/shop/carrinho/asp/abrirconexaoaux.php:25) in /home/sites/site57/web/index/shop/carrinho/asp/addencomenda.php on line 35
Insert into carro (produto, preco, Idencomenda,data) values (“AUTO-CURA -”,“15.47”,“ca7d14a3cc6a3d8c4cb862b53ecbc0cf”,“2004-06-24”)
I then opened this file called “addencomenda.php” which is “addorder” in english, and this is the code which it contains:
<?php
include("abrirconexaoaux.php");
$ProdutName="";
//echo count($HTTP_POST_VARS);
$count=0;
$desc="";
if($flag == "1")
{
while (list($name, $value) = each($HTTP_POST_VARS) and $count<$ncara)
{
$count++;
$auxpr=explode("&","$value");
if(count($auxpr)>1)
{
$desc.="$name $auxpr[0]; ";
$pp="$auxpr[1]";
}
else $desc.=" $value; ";
}
//echo $desc;
//echo $pp;
//exit();
$ProductName="$produto, caracteristicas: $desc";
}
else
{
$ProductName=$produto;
$pp=$preco;
}
$ProductName=trim($ProductName);
$ProductName=addslashes($ProductName);
$sess=session_id();
if($sess=="")
{
session_start();
$sess=session_id();
}
$sess=trim($sess);
$dt=date("Y-m-d");
$sql="Insert into carro (produto, preco, Idencomenda,data) values ("$ProductName","$pp","$sess","$dt")";
//echo $sql;
if(!mysql_query ($sql))
{
echo $sql;
exit();
}
include("fecharconexao.php");
header("Location: ./carrinho.php");
exit();
?>
I need this urgently, would someone please be kind enough to look over this and find the problem… Thanks… If you need anything else I will provide you with it asap.
Thanks in advance,
Prodigal Systems Admin,
Jason Vincent[/code]