Prev: strtotime woes
Next: Inconsistent json_decode() results
From: David McGlone on 5 May 2010 13:04 On Wednesday 05 May 2010 12:59:00 Peter Lind wrote: > On 5 May 2010 18:55, David McGlone <david(a)dmcentral.net> wrote: > > I've checked and checked and re-checked and I can't figure out what I've > > done wrong. I'm getting a parse error: > > > > Parse error: syntax error, unexpected T_VARIABLE in > > /home/david/www/Joe/current/presentation/smarty_plugins/function.load_pro > >ducts_list.php on line 27. > > > > Can anyone spot my error? I'd appreciate the help. > > > > Here is the function.load_products_list.php file: > > > > 1. <?php > > 2. function smarty_function_load_products_list($params, $smarty) > > 3. { > > 4. $products_list = new $ProductsList(); > > 5. $products_list->init(); > > 6. > > 7. //assign the template variable > > 8. $smarty->assign($params['assign'], $products_list); > > 9. } > > 10. > > 11. //Manage the products list > > 12. class ProductsList > > 13. { > > 14. public $mProducts; > > 15. public $mSelectedProduct; > > 16. > > 17. private $mBoCatalog; > > 18. > > 19. //constructor initializes business tier object > > 20. //and reads query string parameter > > 21. function __construct() > > 22. { > > 23. //creating the middle tier object > > 24. $this->mBoCatalog = new BoCatalog(); > > 25. //if ProductID exists in the query string, we're viewing > > a product. 26. if(isset($_GET['ProductID'])) > > 27. $this->mSelectedProduct = (init)$_GET['ProductID']; > > pretty sure (init) is not a valid cast ... Your hunch is correct. LOL Still can't believe I overlooked that so many times. -- Blessings, David M.
From: David McGlone on 5 May 2010 13:06 On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: > On Wed, May 5, 2010 at 12:55 PM, David McGlone <david(a)dmcentral.net> wrote: > > 26. if(isset($_GET['ProductID'])) > > 27. $this->mSelectedProduct = (init)$_GET['ProductID']; > > You've got (init) instead of (int). Its always those little characters > causing trouble! Tell me about it. I kept telling myself for the last 4 hours "I can find it, I can find it I don't need to ask the list" Huh! I was wrong! -- Blessings, David M.
From: Dan Joseph on 5 May 2010 13:12 On Wed, May 5, 2010 at 1:06 PM, David McGlone <david(a)dmcentral.net> wrote: > On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: > > On Wed, May 5, 2010 at 12:55 PM, David McGlone <david(a)dmcentral.net> > wrote: > > > 26. if(isset($_GET['ProductID'])) > > > 27. $this->mSelectedProduct = (init)$_GET['ProductID']; > > > > You've got (init) instead of (int). Its always those little characters > > causing trouble! > > Tell me about it. I kept telling myself for the last 4 hours "I can find > it, I > can find it I don't need to ask the list" Huh! I was wrong! > > > > LOL sometimes a second set of eyes is required. We've all been in your shoes! -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code "NEWTHINGS" for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry
From: Paul M Foster on 5 May 2010 16:19 On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote: > On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote: > > On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: > > > I've checked and checked and re-checked and I can't figure out what I've > > > done wrong. I'm getting a parse error: > > > <snip> > > WOW!!!! I have spent at least 4 hours reading and re-reading it and it took > you 3 seconds. > > That was the problem. How, how, how could I have overlooked that so many > times???? > > Thank you Ashley, I should have asked you 3 hours ago. ;-) Yeah, David, the rest of us are really disappointed in you. I mean, it's not like that's ever happened to *us*. ;-} Paul -- Paul M. Foster
From: David McGlone on 5 May 2010 21:02
On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote: > On Wed, May 5, 2010 at 1:06 PM, David McGlone <david(a)dmcentral.net> wrote: > > On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: > > > On Wed, May 5, 2010 at 12:55 PM, David McGlone <david(a)dmcentral.net> > > > > wrote: > > > > 26. if(isset($_GET['ProductID'])) > > > > 27. $this->mSelectedProduct = (init)$_GET['ProductID']; > > > > > > You've got (init) instead of (int). Its always those little characters > > > causing trouble! > > > > Tell me about it. I kept telling myself for the last 4 hours "I can find > > it, I > > can find it I don't need to ask the list" Huh! I was wrong! > > LOL sometimes a second set of eyes is required. We've all been in your > shoes! > True. I need to learn to ask for help, but I don't want to fall into the habit of taking it for granted. I'm still learning so I need to try my hardest before I go getting an answer. -- Blessings, David M. |