Pos, Really, you shouldn't have posted this here as it's a general PHP question, not related to CakePHP at all.
But the thing you're doing wrong here is simple. Where you have: echo var1; echo var2; You should have: echo $var1; echo $var2; Variables need to be prefixed with $ wherever they are used, not just when they are initially created. Hope that helps, and good luck with your learning. On Oct 30, 8:15 pm, Pos Weyb <[EMAIL PROTECTED]> wrote: > Hi, I am a newbie to PHP. I am working my way through a PHP class on > Lynda.com and have run into the following error when trying to define > simple variables. I searched the messages for this type of error and > I suspect I have an error reporting setting too high??? But I still > don't know what to do about it! > > Here is my code: > > <html> > <head> > > <title>Variables</title> > </head> > > <body> > <?php > $var1 = 10; > $var2 = "Ye Hah"; > echo var1; > echo var2; > ?> > </body> > </html> > > Here is the error message I get when I try to view it in my > browser. > > Notice: Use of undefined constant var1 - assumed 'var1' in C:\wamp\www > \php_sandbox\Variables.php on line 11 > var1 > Notice: Use of undefined constant var2 - assumed 'var2' in C:\wamp\www > \php_sandbox\Variables.php on line 12 > var2 > > Can anyone see what I am not seeing? What am I doing wrong? > > Thanks > > Pos Weyb --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---