Jump to content

PHP if statement not working


Mr.Canuck

Recommended Posts

Hey everyone. I had some great help on here so far with this and as a result I have written an if statement so that a part of the code is not executed when a certain page is displayed.

 

So, if you look at the following piece of code, you will see that I want to exclude this code from executing only when the page "products" is displayed. The full URL of that page is: http://store.scrapbookingfanatics.com/index.php?cpage=products

 

For some reason, the div id "rightside" and the "showCart" and "showSidebar" are still being executed when the products page is displayed. It is my understanding that the following if statement should prevent this from happening. Am I missing something??

 

Thanks,

 

<?php
if(!$cpage == "products"){
?>

<div id="rightside">

<?php if($this->showCart()) $this->cartPnl->Render(); ?>

<div style="clear: both;">
<?php if($this->showSideBar()) $this->sidePnl->Render(); ?>
</div>

</div>

<?php
}
?>
</div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.