|
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.
Navigation:
[Reply to this message]
|