kohalabill Posted September 18, 2011 Posted September 18, 2011 I am trying to detect the page such as product_reviews, so I placed the following code in template_top so it would be in the head of the page. <?php $testPage = $_SERVER['PHP_SELF']; if (stristr($testPage, 'product_info.php')){ echo '<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"> <link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" /> <script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>'; }elseif (stristr($testPage, 'product_reviews.php')) { echo '<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">'; } ?> It seems really strange because I am able to use this inside the page itself: <?php $testPage = $_SERVER['PHP_SELF']; if (stristr($testPage, 'product_info.php')){ echo $testPage; } ?> I'm sure its scope related, but any ideas how I could implement this? Thanks, Bill
♥toyicebear Posted September 19, 2011 Posted September 19, 2011 you can use basename($PHP_SELF) == Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here]
Recommended Posts
Archived
This topic is now archived and is closed to further replies.