Tema: Error en php
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/08/2010, 15:46
felcorp
 
Fecha de Ingreso: agosto-2010
Mensajes: 4
Antigüedad: 14 años, 3 meses
Puntos: 0
De acuerdo Error en php

Buenas tardes, me gustaria que me ayudaran con este error.

Fatal error: main() [<a href='function.main'>function.main</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;cls&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in C:\AppServ\www\yupeephone\consulta.php on line 31

donde tengo estos archivos.

consulta.php
Código PHP:
Ver original
  1. <?php
  2. require_once('conexion.php');
  3. require_once('cls.php');
  4.     if (!isset($_SESSION["coupons"])){
  5.     $_SESSION["coupons"] = new cls();
  6.    
  7.     }  
  8. //tablas  
  9.  $conexion = new conexion();
  10.      
  11.      if($conexion->abre_conexion() == 1)
  12.     {
  13.    
  14.     $campania=$_SESSION['campania'];
  15.    
  16.     $v_clic_coupons = mysql_query("select distinct
  17.    `tblhosting`.`domain` AS `domain`,
  18.    `tblproducts`.`name` AS `productname`,
  19.     `tblhosting`.`userid` AS `userid`,
  20.     `coupons`.`active` AS `active`,
  21.     `tblhosting`.`id` AS `idhosting`,
  22.     `detailscoupons`.`id` AS `iddetailscoupons`,
  23.    `detailstypecoupons`.`description` AS `description`
  24.   from
  25.    (((((`tblproducts` join `tblhosting` on((`tblproducts`.`id` = `tblhosting`.`packageid`))) join `detailscoupons` on((`detailscoupons`.`idproducts` = `tblproducts`.`id`))) join `detailstypecoupons` on((`detailscoupons`.`iddetailstypecoupons` = `detailstypecoupons`.`id`))) join `typecoupons` on((`typecoupons`.`id` = `detailstypecoupons`.`idtypecoupons`))) join `coupons` on((`detailscoupons`.`id` = `coupons`.`iddetailscoupons`)))
  26.  where tblhosting.userid='".$_SESSION['iduser']."' and tblhosting.domainstatus='Active' and typecoupons.name='".$campania."' group by tblhosting.id;");
  27.  
  28.     while ($registroclic = mysql_fetch_array($v_clic_coupons))
  29.      {
  30.         $_SESSION["coupons"]->introduce($registroclic[productname],$registroclic[domain],$registroclic[description],"<a style=\"text-decoration:underline;cursor:pointer;\"onclick=\"enviarDatos($registroclic[userid],$registroclic[idhosting],$registroclic[iddetailscoupons])\">Activar</a>");
  31.                
  32.     }//Fin del while
  33.    
  34.     $_SESSION["coupons"]->imprime();
  35.    
  36.     }//fin del if
  37.  
  38.     $conexion->cierra_conexion();
  39. ?>

y cls.php
<?php
session_start();

Código PHP:
Ver original
  1. class cls {
  2.  
  3.      var $array_productname;
  4.      var $array_domain;
  5.      var $array_description;
  6.      var $array_active;  
  7.      var $num;
  8.      
  9.     function __construct ()
  10.     {
  11.       $this->num=0;
  12.     }  
  13.    
  14.     function cls ()
  15.     {
  16.        $this->num=0;
  17.     }
  18.    
  19.     function introduce($prod,$domain,$descrip,$active){
  20.    
  21.        $this->array_productname[$this->num]=$prod;
  22.        $this->array_domain[$this->num]=$domain;
  23.        $this->array_description[$this->num]=$descrip;
  24.        $thia->array_active[$this->num]=$active;  
  25.        $this->num++;
  26.       }
  27.  
  28.     function imprime(){
  29.  
  30.     for ($i=0;$i<$this->num;$i++)
  31.     {
  32.         if($this->array_productname[$i]!=0)
  33.         {
  34.         $nada=1;
  35.         echo '<TD>' . $this->array_productname[$i].'<br>'.$this->array_domain[$i]. '</TD> '  ; //
  36.         echo '<TD > &nbsp;</TD> '  ; //
  37.         echo '<TD>' . $this->array_description[$i].'</TD> '  ; //
  38.         echo '<td>'.$this->array_active[$i].'</td>';
  39.         echo $this->num;
  40.         }
  41.     }
  42.         echo "</TR>";
  43.        
  44.        if($nada== 0)
  45.         {
  46.         echo "<tr align='center' valign='middle'><td colspan='8'>Sin resultados</td></tr>";
  47.         }
  48.  
  49.     }
  50.    
  51.     function elimina($linea){
  52.        $this->array_productname[$linea]=0;
  53.     }
  54.    
  55.     function retorna_total()
  56.     {
  57.        return $this->num;
  58.     }
  59.  
  60. }
  61. ?>

Muchas gracias de antemano, y que tengan buen dia.