...

View Full Version : Very quick PHP help



howard-moore
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?

Thanks,
Neil

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

Try using a switch instead.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum