You are here: Re: Need help with class « PHP Programming Language « IT news, forums, messages
Re: Need help with class

Posted by myzmlm on 01/22/08 19:02

On Jan 22, 1:54 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Tue, 22 Jan 2008 19:41:01 +0100, <myz...@gmail.com> wrote:
> > I want to include class in one php page. However I couldn't get it
> > working? I didn't get any error message but I didn't get the html page
> > either. Any one could help me? Thanks.
>
> > <?php
> > function __autoload($class)
> > {
> > if (file_exists($file = "$class.php"))
> > {
> > include($file);
> > }
> > else
> > {
> > throw new Exception("Class $class not found");
> > }
> > }
>
> > try
> > {
> > class_exists('pd');
>
> What do you expect this does?
>
> > $remo = new pd();
>
> > ?>
> > <html>
> > <head>
> > </head>
> > <body>
> > <div id='div1'>test<br />
> > <?php
> > print $remo.test();
>
> $remo->test();
>
> Be sure to enable display_error and set error_reporting to E_ALL |
> E_STRICT during development (in php.ini, httpd.conf or .htaccess).
>
> --
> Rik Wasmus

echo $remo->test() should output 2 on the web page. However I got a
zero size output html file, which means there is something wrong with
code. If I comment out the class part it will work without problem. I
just can't figure out what's wrong with the class. I am using IIS6. I
couldn't find display_error in php.ini.
Thanks.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация