Foros del Web » Programando para Internet » PHP »

Extraño error

Estas en el tema de Extraño error en el foro de PHP en Foros del Web. Hola al abrir una ventana desde un link de mi aplicación , obtengo un extraño error, donde los nombres de los archivos invocados desde include_once, ...
  #1 (permalink)  
Antiguo 26/05/2011, 12:12
 
Fecha de Ingreso: octubre-2007
Mensajes: 267
Antigüedad: 16 años, 5 meses
Puntos: 1
Extraño error

Hola

al abrir una ventana desde un link de mi aplicación , obtengo un extraño error, donde los nombres de los archivos invocados desde include_once, aparecen sin el primer caracter. A saber:

Warning: include_once(include acturas.php) [function.include-once]: failed to open stream: Invalid argument in E:\produccion_php\wamp\www\academia\AccesoRapidoDe talleFacturacion.php on line 6

El archivo se llama facturas.php pero en elerror se observa sin el primer caracter.

Lo raro es que otros include_once son ejecutados previamente sin esta mala suerte.

Gracias de antemano.
  #2 (permalink)  
Antiguo 26/05/2011, 12:22
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Extraño error

Pero sin ver el código que ejecuta el include_once, ¿que te podemos decir?
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 26/05/2011, 22:45
 
Fecha de Ingreso: octubre-2007
Mensajes: 267
Antigüedad: 16 años, 5 meses
Puntos: 1
Respuesta: Extraño error

facturas.php

Código PHP:
<?php

include_once("ABM.php");
include_once(
"conexion.php");


class 
Factura extends ABM
{
    var 
$id_factura;
    var 
$id_local;
    var 
$fecha;
    var 
$fechaLocal;
    var 
$id_cliente;
    var 
$condicion_venta;
    var 
$condicion_iva;
    var 
$cuit;
    var 
$monto;

    function 
Factura()
    {
        
$this->ABM();
        
$this->nombre_tabla 'facturas';
        
$this->nombre_campo_id 'id_factura';
        
$this->id_factura = &$this->id;
    }

    function 
definirConexion($conexion)
    {
        
$this->conexion $conexion;
    }
    
    function 
setFechaLocal($f)
    {
        
$this->fechaLocal $f;
        
//Formatear fecha
        
$dia substr($f,0,2);
        
$mes substr($f,3,2);
        
$anio substr($f,6,4);
        
$this->fecha $anio."/".$mes."/".$dia;
    }
     

    function 
buscarPorMatricula($matricula)
    {
        
$this->res mysql_query("SELECT * FROM facturas WHERE matricula = $matricula->matricula;"$this->conexion->conexion);
        return 
$this->siguiente();
    }

    function 
asignarCampos($reg)
    {
        
$this->id_factura $reg['id_factura'];
        
$this->id_local $reg['id_local'];
        
$this->fecha $reg['fecha'];
        
$this->id_cliente $reg['id_cliente'];
        
$this->condicion_venta $reg['condicion_venta'];
        
$this->condicion_iva $reg['condicion_iva'];
        
$this->cuit $reg['cuit'];
        
$this->monto $reg['monto'];
            
    }

    function 
agregar()
    {
        
mysql_query("INSERT INTO facturas VALUES (
                                            0,                                 $this->id_local,
                                                '$this->fecha',
                                                 $this->id_cliente,                            '$this->condicion_venta',
                                            '$this->condicion_iva',
                                            '$this->cuit',
                                            $this->monto
                                            )"
$this->conexion->conexion) or die ("Invalid query");
                                            return 
$this->ultimoId();
    }

    function 
modificar()
    {
            
        
mysql_query("UPDATE facturas SET
                                               id_factura = $this->id_factura, 
                                               id_local = $this->id_local, 
                                               fecha = '$this->fecha', 
                                               id_cliente = $this->id_cliente, 
                                               condicion_venta = $this->condicion_venta,
                                               condicion_iva = $this->condicion_iva,
                                               cuit = $this->cuit,
                                               monto = $this->monto
                         WHERE id_factura = $this->id_factura;"
$this->conexion->conexion);

        return 
$this->id;
    }



}

?>
  #4 (permalink)  
Antiguo 26/05/2011, 23:02
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Extraño error

Eso no, me refiero al código que produce el error.

Osea, el script que realiza el:
Cita:
include_once(include?acturas.php)
¿Será?
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 26/05/2011, 23:04
 
Fecha de Ingreso: octubre-2007
Mensajes: 267
Antigüedad: 16 años, 5 meses
Puntos: 1
Respuesta: Extraño error

Código PHP:
<?php
    
include_once("include\conexion.php");
    include_once(
"include\sesion.php");
    include_once(
"include\usuario.php");
    include_once(
"include\caja.php");
    include_once(
"include\facturas.php");
    include_once(
"include\recibos.php");
    include_once(
"include\notas_credito.php");
    
//include_once("include\fecha.php");
    
    
$s = new Sesion();
    if(!
$s->verificarSesion()) header("Location:itte.php");
    
date_default_timezone_set('America/Argentina/Buenos_Aires');
    
//$fe = new fecha(1);

    
$c = new Conexion();
    if(!
$c->conectar()){
        
$c->error;
        exit;
    }
    
    if(isset(
$_GET['idr'])) {
        
$idr $_GET['idr'];
        
$cond "id = $idr";
        
$rec = new recibo();
        
$rec->definirconexion($c);
        
$resr $rec->consulta($cond);
        } else if(isset(
$_GET['idf'])) {
            
$idf $_GET['idf'];
            
$cond "id = $idf";
            
$fac = new factura();
            
$fac->definirconexion($c);
            
$resf $fac->consulta($cond);
            }
            else echo 
"No hay documento para mostrar.";
    
    if(
$resr) {
        
$idRec $rec->id_recibo;
        
$cond "id_recibo = $idRec order by id_detalle_recibo asc";
        
$dr = new Detalles_Recibos();
        
$dr->definirconexion($c);
        
$resDr $dr->consulta($cond);
        if(
$resDr){
            do{
                
$i++;
                
$idRec $dr->id_recibo;
                
$concepto $dr->concepto;
                
$cantidad $dr->cantidad;
                
$monto $dr->monto;
                
$reg[$i] = "<tr><td>$concepto</td><td>$cantidad</td><td>$monto</td></tr>";
            } while (
$dr->siguiente());
        }
    } else if(
$resf) {
            
$idFac $fac->id_factura;
            
$cond "id_factura = $idFac order by id_detalle_factura asc";
            
$df = new Detalles_Facturas();
            
$df->definirconexion($c);
            
$resDf $df->consulta($cond);
        }
        
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Frm Caja</title>
<link href="estilos/sueltos.css" rel="stylesheet" type="text/css">
<link href="estilos/links.css" rel="stylesheet" type="text/css">
<link href="estilos/forms.css" rel="stylesheet" type="text/css">
</head>

<body>
<?php

    
function AFechaEsp($DateTime){ //recibe una fecha en formato mysql y pasa a formato español
        
if($DateTime != 0){
            
setlocale (LC_TIME'SP');
            
$a substr($DateTime04);
            
$m substr($DateTime52);
            
$d substr($DateTime82);
            
$h substr($DateTime115);
            
$res "$d-$m-$a $h hs"
        }
        return 
$res;
    }


    if(
$i){
        for(
$j=1;$j<=$i;$j++){
            echo 
"<table cellspacing='5'>";
            if(
$resr) echo "<tr><td colspan='2'><b>Recivo Nro. $idRes</b></td></tr>";
            else if(
$resf) echo "<tr><td colspan='2'><b>Factura Nro. $idFac</b></td></tr>";
            echo 
$reg[$j];
            echo 
"</table>";
        }
}

?>
</body>
</html>
  #6 (permalink)  
Antiguo 27/05/2011, 08:44
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: Extraño error

El problema es que estas usando \ para separar, tus directorios, debes de usar /:
Código PHP:
Ver original
  1. include ("foo/bar.php");

Esto es porque el \ al estar en la cadena trata de interpretar el caracter, por decir \t es un tabulador, \r es un retorno de carro, etc.

Saludos.

Etiquetas: extraño
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:59.