Thread: PHP syntax help

Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: PHP syntax help

    putting the code there is why your conditional test was returning false: the variable $i isn't set until the loop a few lines further down...
    You'll need to run the whole logic loop there to see if one of your options is size:

    try this:
    Code:
    <?php if ($zv_display_select_option > 0) { ?>
    <h5 id="attribsOptionsText">
    <?php
        for($i=0;$i<sizeof($options_name);$i++) {
           if ($options[$i] == 'Size') {
    ?>
     <!-- bof Popup Size Help 2/2k7/07 -->
    <a href="javascript:popupSizeHelp('http://www.ktnaturals.com/catalog/includes/extra_datafiles/sizehelp.html')"><img src="http://www.ktnaturals.com/catalog/includes/templates/custom/images/icons/help.gif" alt="Size Help"></a>
    <!-- eof Popup Size Help -->
    <?php 
        }
      }
    ?>
    <?php echo TEXT_PRODUCT_OPTIONS; ?></h5>
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  2. #2
    Join Date
    Dec 2006
    Location
    Ohio
    Posts
    198
    Plugin Contributions
    0

    Default Re: PHP syntax help

    It's still not working.

    The code is fine - it doesn't seem like it can match the word "Size." I can get it to echo $options_name as Size, so there's gotta be something else missing... I tried both upper & lower cases. It would be really cool if I can get this to work...

 

 

Similar Threads

  1. Help with PHP syntax on sidebox
    By sunflowertami in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 24 Aug 2008, 12:34 PM
  2. Help with PHP syntax please?
    By sunflowertami in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Jun 2008, 11:48 AM
  3. Please help! php syntax needed to call images!
    By Vood in forum General Questions
    Replies: 3
    Last Post: 31 Oct 2007, 09:59 PM
  4. Easy PHP syntax question -- help please?
    By magicpants in forum General Questions
    Replies: 2
    Last Post: 17 Jan 2007, 02:31 PM
  5. Php Syntax Help - Custom Fields Switch
    By voltage in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 22 Jul 2006, 05:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg