View Full Version : Very quick PHP help

05-19-2011, 11:40 AM
Hi All,

I have a very short bit of PHP code where a page is called if parameters are met. However, the unique 'code' for the page is very similar to another page, and this is causing problems. See below:

<?php if ($code == 'council')
include ("php-bin/list_council_pages_dt.php"); ?>

The two pages have 'code' fields of 'council' and 'councillors', and when it is on 'councillors' it is including the above file, and I don't want this to happen. Is there a way of restricting the 'IF' call to the exact word and not a part of it?


05-19-2011, 11:59 AM
Odd because it shouldn't be doing that.

Try using a switch instead.