Images seem to be ignoring php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
avarice
Forum Newbie
Posts: 2
Joined: Thu Mar 18, 2010 4:40 am

Images seem to be ignoring php code

Post by avarice »

Hi, I'm completely new to php and i'm doing some modifications to a script. Most of it i managed to get working to trial and error + reading up, except for this 1 problem

I've got 2 images, 1 is supposed to present at all times, and the 2nd one is only to appear when the user meets a certain criteria.
For some reason, if the users have less then the minimum points i've set the one that is supposed to be present at all times doesn't appear. Both appear only when the user has met the criteria for the number of points. To my knowledge i can't understand what's wrong. Hoping you guys could help out and thank you in advance for taking the time to help.

Code: Select all

<div class="about_txt"> <span style="float:right;"><a href="#" onclick="startGateway('Mjc4Njg%3D');"><img src="images/earn_points.jpg" width="195" height="100" border="0" /></a><br /> 
          <?php if ($pointsneeded <= 0){?>
          <a href="request.php"><img src="images/claim_voucher.jpg" width="195" height="100" border="0" /></a>
          <?php } ?>
ps: I think i did it correctly, but its supposed to be (earn_points.jpg) appearing at all times regardless of the number of points a user has and (claim_voucher) only appearing after achieving the minimum number of points.
Last edited by avarice on Thu Mar 18, 2010 9:32 am, edited 1 time in total.
dejvos
Forum Contributor
Posts: 122
Joined: Tue Mar 10, 2009 8:40 am

Re: Images seem to be ignoring php code

Post by dejvos »

This piece of code seems to be ok. May be it could be better to send more code.
avarice
Forum Newbie
Posts: 2
Joined: Thu Mar 18, 2010 4:40 am

Re: Images seem to be ignoring php code

Post by avarice »

Hi thanks for the reply, here's additional codes from the script.!

Code: Select all

</div>
          </div></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table></td>
      <td height="400" align="left" valign="top"><div style="margin:10px;">
        <div class="about_txt"> <span style="float:right;"><a href="#" onclick="startGateway('Mjc4Njg%3D');"><img src="images/earn_points.jpg" width="195" height="100" border="0" /></a><br /> 
          <?php if ($pointsneeded <= 0){?>
          <a href="request.php"><img src="images/claim_voucher.jpg" width="195" height="100" border="0" /></a>
          <?php } ?>
      </span>
        <h2>Members Area</h2>
        <br />
        <p><br />
          </p>
        <p><br />
          <a href="request.php">Click here</a> to contact us to confirm your selection, and email address.<br />
          <?php } ?>
          <br />
          <br />
        </p>
        <h2>&nbsp;</h2>
Post Reply