FW: error de php!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list!

I'm migrating to a new server, the old was:
-Apache/2.0.46 (Unix) y PHP/4.3.2
-MySQL 4.0.13
-Solaris 8

The following script used to run nicely in the old sever, but now that I
migrated the script to a new server with Apache/2.0.54 (Unix Solaris 9),
PHP/5.0.5 and MySQL 5.0.18.

I got the following error:
Fatal error: Cannot access empty property in
/usr/local/apache2/htdocs/intranet/phpclass/cdate.php on line 44

I hope any one here can help me!! Best Regards!!
I'm noting out line 44 in the following code fragment!

<?php
class CDate
{
  var $mDate;   // in actual OOP it should be private
  var $NumDias;
  var $AddmDate;

  function CDate($d=0,$m=0,$y=0)
  {
    If ($y==0) // these three "if" are necessary because default parameters
must be constants.
    { $y=Date("Y"); }
    If ($m==0)
    { $m=Date("m"); }
    if ($d==0)
    { $d=Date("d"); }
    $this -> mDate = Date("d-m-Y",mktime(0,0,0,$m,$d,$y));
  }  // end of constructor

  function AddTime($y=0,$m=0,$d=0) // this method adds y years, m months and
d days to date
  {
    $array_date = explode("-",$this->mDate);
$this->AddmDate=Date("d-m-Y",mktime(0,0,0,$array_date[1]+$m,$array_date[0]+$
d,$array_date[2]+$y));
  }  // end of AddTime
  // Devuelve el numero de dias que hay entre 2 fechas.
  function DifTime($d1, $m1, $y1, $d2, $m2, $y2)
   {
    $unixtime1=mktime(0,0,0,$m1,$d1,$y1);
    $unixtime2=mktime(0,0,0,$m2,$d2,$y2);
    $this->$NumDias = $unixtime2 - $unixtime1;   <--- This is the line 44
   }
   // Devuelve el resultado del numero de dias entre un intervalo.
  function ReadNumDias()
   {
    return ($this->$NumDias / 86400)+1;
   }
   // crea un arreglo en donde pone las fechas intermedias de un intervalo
dado
  function ArregloDias($d2,$m2,$y2)
   {
    $date_ini = explode("-",$this->mDate);
    $alarray=
Date("Y-m-d",mktime(0,0,0,$date_ini[1],$date_ini[0],$date_ini[2]));
    $aux=
Date("d-m-Y",mktime(0,0,0,$date_ini[1],$date_ini[0],$date_ini[2]));
//introduce el primer dato al array
    $this -> DifTime($date_ini[0],$date_ini[1],$date_ini[2],$d2,$m2,$y2);
//Calcula el No. de dias entre intervalos
    for($i=0;$i<$this -> ReadNumDias();$i++)
     {
       $dato_proc = explode("-", $alarray);
       $date_proc = explode("-", $aux); // Exploda el valor anterior del
array
       $aux=Date("d-m-Y",mktime(0,0,0, $date_proc[1], $date_proc[0]+1,
$date_proc[2])); //Calcula el siguiente valor y se lo asigna al array.
       $alarray=Date("Y-m-d",mktime(0,0,0, $date_proc[1], $date_proc[0]+1,
$date_proc[2]));
       $ArrayDias[$i]=$dato_proc[0]."-".$dato_proc[1]."-".$dato_proc[2];
     }
     return $ArrayDias;
   }

  function ReadArray()
   {
    return $this -> $ArrayDias;
   }
  // If you are a rigorous man, the following method should be your way to
access date
  function ReadDate()
  {
    return $this->AddmDate;  // you get the date in same format as
Date("Y-m-d")
  }  // ends of ReadDate

}  // end of declaration class CDate
?>
















      Este mensaje es exclusivamente para el uso de la persona o entidad a
quien esta dirigido; contiene informacion estrictamente confidencial y
legalmente protegida, cuya divulgacion es sancionada por la ley. Si el
lector de este mensaje no es a quien esta dirigido, ni se trata del empleado
o agente responsable de esta informacion, se le notifica por medio del
presente, que su reproduccion y distribucion, esta estrictamente prohibida.
Si Usted recibio este comunicado por error, favor de notificarlo
inmediatamente al remitente y destruir el mensaje. Todas las opiniones
contenidas en este mail son propias del autor del mensaje y no
necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna
de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este
mensaje intencionalmente no contiene acentos.

      This message is for the sole use of the person or entity to whom it is
being sent. Therefore, it contains strictly confidential and legally
protected material whose disclosure is subject to penalty by law. If the
person reading this message is not the one to whom it is being sent and/or
is not an employee or the responsible agent for this information, this
person is herein notified that any unauthorized dissemination, distribution
or copying of the materials included in this facsimile is strictly
prohibited. If you received this document by mistake please notify
immediately to the subscriber and destroy the message. Any opinions
contained in this e-mail are those of the author of the message and do not
necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of
its control, controlled, affiliates and subsidiaries companies. No part of
this message or attachments may be used or reproduced in any manner
whatsoever.<

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux