hiveman Posted January 26, 2008 Share Posted January 26, 2008 I am new at all this. I am trying to modify the thumbnail page for a php store. The php code for the thumbnails just gave a thumbnail image of the product and price and a few links. I've modified it to allow for ordering the product, to see how many products are still in stock and select product options. I've also have a section where more details about the product are revealed. It shows a large image of the product and a description of the product. The variables for the image<?=$Large_Image?> and description<?=$Description?> I got from the php code for the product detail page. At the bottom of the detail page it will also post any discounts<?=$Discounts?> associated with the product. When I transfer these variables for the thumbnail page it will show the large image and details about the product however it will not post the discounts. Does anyone know why <?=$Discounts?> will not work? Is there a way calling it up from mysql? This may be a dumb question but exactly where does the php code pick up the data when the php has <?= in the front side of the variable? Quote Link to comment https://forums.phpfreaks.com/topic/87877-why-will-some-variables-work-but-not-others/ Share on other sites More sharing options...
revraz Posted January 26, 2008 Share Posted January 26, 2008 <?= is short for <?php echo So it looks to see what is defined as $Discounts and echo's it. Variables are case sensitive as well. Quote Link to comment https://forums.phpfreaks.com/topic/87877-why-will-some-variables-work-but-not-others/#findComment-449605 Share on other sites More sharing options...
hiveman Posted January 26, 2008 Author Share Posted January 26, 2008 The PHP interpreter <?=$Discounts?> is pasted right from the php in the details page. The discounts show up in the details page but will not in the thumbnail page. Since I pasted it the case should not be the problem. Why can't it find the contents for the variable? Quote Link to comment https://forums.phpfreaks.com/topic/87877-why-will-some-variables-work-but-not-others/#findComment-449612 Share on other sites More sharing options...
p2grace Posted January 26, 2008 Share Posted January 26, 2008 Is the variable set in thumbnails page? Do a isset($Discounts) and see if it returns true or false. Quote Link to comment https://forums.phpfreaks.com/topic/87877-why-will-some-variables-work-but-not-others/#findComment-449801 Share on other sites More sharing options...
revraz Posted January 26, 2008 Share Posted January 26, 2008 Sounds like you are dealing with two different pages, and the variable is set in one and not the other. The PHP interpreter <?=$Discounts?> is pasted right from the php in the details page. The discounts show up in the details page but will not in the thumbnail page. Since I pasted it the case should not be the problem. Why can't it find the contents for the variable? Quote Link to comment https://forums.phpfreaks.com/topic/87877-why-will-some-variables-work-but-not-others/#findComment-449804 Share on other sites More sharing options...
wildteen88 Posted January 26, 2008 Share Posted January 26, 2008 How is the $Large_Image and $Description variables created? You'll need to post some code. Quote Link to comment https://forums.phpfreaks.com/topic/87877-why-will-some-variables-work-but-not-others/#findComment-449806 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.