Al subir la pagina al servidor me da este error:
Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3.
Please be advised that the session extension does not consider global variables as a source of data,
unless register_globals is enabled. You can disable this functionality and this warning by setting
session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
Con este codigo:
Código PHP:
<?
session_start();
include ('func.php');
$_SESSION['usuario'];
$cart = $_SESSION['cart'];
$total_price = $_SESSION['total_price'];
$username = $_SESSION['usuario'];
$nombre = $_POST["nombre"];
$apellido = $_POST["apellido"];
$ci = $_POST["ci"];
$telefono = $_POST["telefono"];
$celular = $_POST["celular"];
$email = $_POST["email"];
$env_avenida = $_POST["env_avenida"];
$env_edif = $_POST["env_edif"];
$env_piso = $_POST["env_piso"];
$env_sector = $_POST["env_sector"];
$env_zona = $_POST["env_zona"];
$env_ciudad = $_POST["env_ciudad"];
$env_estado = $_POST["env_estado"];
$env_pais = $_POST["env_pais"];
$conexion = db_connect();
if (!$conexion)
return 0;
//GENERAR NUMERO DE FACTURA
$sql1 = "select max(factid) as autonumerico from facturas";
$soc = mysql_query($sql1, $conexion) or die( mysql_error() );
$rs_factid= mysql_fetch_assoc($soc);
$factid= $rs_factid['autonumerico'] + 1;
function Zeros($numero, $largo)
{
$resultado = $numero;
while(strlen($resultado) < $largo)
{
$resultado = "0".$resultado;
}
return $resultado;
}
$valor = $factid;
$autoceros = Zeros($valor, 5);
//SELECCIONAR ID
$query = mysql_query("SELECT id from clientes WHERE
usuario='$username' AND nombre = '$nombre' AND apellido ='$apellido' and ci = '$ci'");
if(mysql_num_rows($query)>0) {
$cliente_id = mysql_result($query, 0, "id");
//INSERTAR DATOS DE LA ORDEN EN TABLA FACTURAS
$date = date("y/m/d H:i:s");
$total_price2= $total_price + ($total_price*12/100);
$query = mysql_query("insert into facturas (n_transaccion, factid, id, total_items, totalAmount, date, fact_status) " .
"values ('', '$autoceros', '$cliente_id', '$total_price', '$total_price2', '$date', 'PARTIAL')");
mysql_query($query);
//SELECCIONAR N_TRANSACCION PARA OBTENER N_TRANSACCION EN VARIABLE
$query3 = mysql_query("select n_transaccion from facturas where
id = '$cliente_id' AND date='$date'");
if(mysql_num_rows($query3)>0) {
$n_transaccion = mysql_result($query3, 0, "n_transaccion");
}
//SELECCIONAR FACTID PARA LLENAR TABLA FACT_ITEMS
$query = mysql_query("select factid from facturas where
id = '$cliente_id' AND date='$date'");
if(mysql_num_rows($query)>0) {
$factid= mysql_result($query, 0, "factid");
}
// insertar cada producto
foreach ($cart as $sku => $qty) {
$sProductQuery = "SELECT nombre_prod, price FROM articulos WHERE sku='$sku' LIMIT 1";
list( $nombre_prod, $price ) = mysql_fetch_array( mysql_query( $sProductQuery ) );
$sQuery = mysql_query("insert into fact_items values ('$factid', '$nombre_prod', '$price', '$qty')");
$sQuery = mysql_query("update articulos set ctdad = ctdad - $qty where sku='$sku'");
//echo $sQuery; // mysql_query( $sQuery ) or die( mysql_error() );}
//$sQtuery = mysql_query("DELETE FROM articulos WHERE ctdad=0");
}
}
header("Location:other.php");
?>