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
https://forums.phpfreaks.com/topic/197128-php-if-statement-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.