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 "cls" 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
<?php require_once('conexion.php'); require_once('cls.php'); $_SESSION["coupons"] = new cls(); } //tablas $conexion = new conexion(); if($conexion->abre_conexion() == 1) { $campania=$_SESSION['campania']; `tblhosting`.`domain` AS `domain`, `tblproducts`.`name` AS `productname`, `tblhosting`.`userid` AS `userid`, `coupons`.`active` AS `active`, `tblhosting`.`id` AS `idhosting`, `detailscoupons`.`id` AS `iddetailscoupons`, `detailstypecoupons`.`description` AS `description` from (((((`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`))) where tblhosting.userid='".$_SESSION['iduser']."' and tblhosting.domainstatus='Active' and typecoupons.name='".$campania."' group by tblhosting.id;"); { $_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>"); }//Fin del while $_SESSION["coupons"]->imprime(); }//fin del if $conexion->cierra_conexion(); ?>
y cls.php
<?php
session_start();
Código PHP:
Ver original
class cls { var $array_productname; var $array_domain; var $array_description; var $array_active; var $num; function __construct () { $this->num=0; } function cls () { $this->num=0; } function introduce($prod,$domain,$descrip,$active){ $this->array_productname[$this->num]=$prod; $this->array_domain[$this->num]=$domain; $this->array_description[$this->num]=$descrip; $thia->array_active[$this->num]=$active; $this->num++; } function imprime(){ for ($i=0;$i<$this->num;$i++) { if($this->array_productname[$i]!=0) { $nada=1; echo '<TD>' . $this->array_productname[$i].'<br>'.$this->array_domain[$i]. '</TD> ' ; // echo '<TD > </TD> ' ; // echo '<TD>' . $this->array_description[$i].'</TD> ' ; // echo '<td>'.$this->array_active[$i].'</td>'; echo $this->num; } } echo "</TR>"; if($nada== 0) { echo "<tr align='center' valign='middle'><td colspan='8'>Sin resultados</td></tr>"; } } function elimina($linea){ $this->array_productname[$linea]=0; } function retorna_total() { return $this->num; } } ?>
Muchas gracias de antemano, y que tengan buen dia.