Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Exclude a div from specific URL


Asia_Expat - 3:45 am on Feb 10, 2011 (gmt 0)


I have a section of faqs. I want the index page of that section to be exempted from displaying a certain div. At the moment, I've got this working...

<?
$url=$_SERVER['PHP_SELF'];
if ( strstr( $url, "faq/" ) )
echo "";
else
echo "<div>groovy stuff</div>";
?>


However, this is omitting the div from every page of the faq directory. I've been trying to figure something out with preg_match but I'm getting nowhere. I can't figure how to detect that the 'faq/' is the end of the URL and I only want to exclude the div that specific URL, and continue to display the div on every other page of the site.

Any pointers? It would also be nice if I could find a way to exlude a list of URLs, rather than just one.


Thread source:: http://www.webmasterworld.com/php/4264952.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com