Re: Parse error: syntax error, unexpected T_ELSE error?
I know this is a long time ago but this is a personal project to learn CakePHP. However after an extremely stressful tenure at my last job I am now back to it. I just wanted to say thank you to all of you for your comments and solutions. It open minded, generous people who respond to ignorant queries like mine that keep people learning and trying... ...unlike my last manager! May he rot in hell. So from all of the newbs thanks to the gurus... cheers ben. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Parse error: syntax error, unexpected T_ELSE error?
Ouch! Jeremy Burns Class Outfit http://www.classoutfit.com On 19 May 2012, at 06:41:42, Ben Morrisson wrote: I know this is a long time ago but this is a personal project to learn CakePHP. However after an extremely stressful tenure at my last job I am now back to it. I just wanted to say thank you to all of you for your comments and solutions. It open minded, generous people who respond to ignorant queries like mine that keep people learning and trying... ...unlike my last manager! May he rot in hell. So from all of the newbs thanks to the gurus... cheers ben. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Parse error: syntax error, unexpected T_ELSE error?
Can anyone tell my why this works: ?php if($facebook_user) echo $this-Facebook-logout(); else echo $this-Facebook-login(); ? p ?php echo debug($facebook_user); ? but this produces the an error (Parse error: syntax error, unexpected T_ELSE in /home/worldtri/public_html/testapp/views/pages/home.ctp on line 8) p ?php if($facebook_user) echo $this-Facebook-logout(); echo debug($facebook_user); else echo $this-Facebook-login(); ? p With thanks for any and all explanations. Benjamin. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Parse error: syntax error, unexpected T_ELSE error?
you should never use if/else without {} the first one works because php accepts if/else without {} for one line statements but as I said, its really ugly and bad practice. On 8 Nov., 13:08, shmeg intertelaustra...@gmail.com wrote: Can anyone tell my why this works: ?php if($facebook_user) echo $this-Facebook-logout(); else echo $this-Facebook-login(); ? p ?php echo debug($facebook_user); ? but this produces the an error (Parse error: syntax error, unexpected T_ELSE in /home/worldtri/public_html/testapp/views/pages/home.ctp on line 8) p ?php if($facebook_user) echo $this-Facebook-logout(); echo debug($facebook_user); else echo $this-Facebook-login(); ? p With thanks for any and all explanations. Benjamin. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Parse error: syntax error, unexpected T_ELSE error?
Because in the second example you have two commands, so when it gets to the else it has lost track with the if. This is ok: if (something) do this; This is ok: if (something) do this; else do that; This is how you nest more than one command: if (something) { do this; then do this; } else { do something else; and then make some tea; } The multiple commands are nested inside {} brackets. Jeremy Burns Class Outfit http://www.classoutfit.com On 8 Nov 2011, at 12:08, shmeg wrote: Can anyone tell my why this works: ?php if($facebook_user) echo $this-Facebook-logout(); else echo $this-Facebook-login(); ? p ?php echo debug($facebook_user); ? but this produces the an error (Parse error: syntax error, unexpected T_ELSE in /home/worldtri/public_html/testapp/views/pages/home.ctp on line 8) p ?php if($facebook_user) echo $this-Facebook-logout(); echo debug($facebook_user); else echo $this-Facebook-login(); ? p With thanks for any and all explanations. Benjamin. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Parse error: syntax error, unexpected T_ELSE error?
On Nov 8, 1:08 pm, shmeg intertelaustra...@gmail.com wrote: Can anyone tell my why this works: ?php if($facebook_user) echo $this-Facebook-logout(); else echo $this-Facebook-login(); ? p ?php echo debug($facebook_user); ? but this produces the an error (Parse error: syntax error, unexpected T_ELSE in /home/worldtri/public_html/testapp/views/pages/home.ctp on line 8) p ?php if($facebook_user) echo $this-Facebook-logout(); echo debug($facebook_user); else echo $this-Facebook-login(); ? p With thanks for any and all explanations. Benjamin. You've accidentally let the cake mixture spill out of the php tin. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php