Reply to Re: Strange warning when trying to create a class

Your name:

Reply:


Posted by ZeldorBlat on 03/09/06 06:30

laredotornado@zipmail.com wrote:
> Hi,
>
> Using PHP 4, I'm trying to create a class, and I get warnings in my
> constructor function like the one below:
>
> Notice: Undefined variable: m_cat_to_buy in
> /usr/local/apache/htdocs/myfiles/dc_fns.php on line 72
>
> Here is the code for my class:
>
> class CProductForFree {
> var $m_cat_for_free = "";
> var $m_sub_cat_for_free = "";
> var $m_style_for_free = "";
> var $m_color_for_free = "";
> var $m_size_for_free = "";
> function CProductForFree($p_cat_for_free,
> $p_sub_cat_for_free,
> $p_style_for_free,
> $p_color_for_free,
> $p_size_for_free)
> {
> $this->$m_cat_for_free = $p_cat_for_free;
> // line 72
> $this->$m_sub_cat_for_free =
> $p_sub_cat_for_free;
> $this->$m_style_for_free = $p_style_for_free;
> $this->$m_color_for_free = $p_color_for_free;
> $this->$m_size_for_free = $p_size_for_free;
> } // CProductForFree
> } // CProductForFree
>
> Why is the warning appearing and what can i do to correct it?
>
> Thanks, - Dave

Tough to tell since you didn't include the code that's actually causing
the error. I suspect it has something to do with whatever is on line
72 of /usr/local/apache/htdocs/myfiles/dc_fns.php.

[Back to original 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

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