cjohnson202 Posted March 9, 2009 Share Posted March 9, 2009 Hello everyone, I am very new to the world of PHP and thus why I am here! I would really like some help on a problem I've been trying to fix for a week but have had no luck. I own a website called hockeyleaks, here is the link: http://www.hockeyleaks.com On the left column, everything below the button ad (but not including it) is a seperate php file called ads.php. My advertisers have requested their ads to only be shown on the main page, but the way my site is set up that ads.php file remain on all pages. Could anyone modify my script to make the ads.php go away when any of the top nav links are clicked? I would forever be in your debt! I have attached the index.php file, any help would be greatly appreciated! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/ Share on other sites More sharing options...
waynew Posted March 9, 2009 Share Posted March 9, 2009 This should work. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-780458 Share on other sites More sharing options...
JonnoTheDev Posted March 9, 2009 Share Posted March 9, 2009 As all your other pages are called from the $_GET['page'] variable you could use this as a condition. Not had a look at the code but guess I dont need to. Easy if(!strlen($_GET['page'])) { include('ads.php'); } Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-780459 Share on other sites More sharing options...
waynew Posted March 9, 2009 Share Posted March 9, 2009 As all your other pages are called from the $_GET['page'] variable you could use this as a condition. Not had a look at the code but guess I dont need to. Easy if(!strlen($_GET['page'])) { include('ads.php'); } Exactly what I did in my edit. I just used isset() instead. Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-780465 Share on other sites More sharing options...
cjohnson202 Posted March 9, 2009 Author Share Posted March 9, 2009 thanks! Like I said, i'm really behind when it comes to PHP, worked like a charm Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-780481 Share on other sites More sharing options...
waynew Posted March 9, 2009 Share Posted March 9, 2009 thanks! Like I said, i'm really behind when it comes to PHP, worked like a charm That'll be $500. Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-780483 Share on other sites More sharing options...
JonnoTheDev Posted March 9, 2009 Share Posted March 9, 2009 each Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-780487 Share on other sites More sharing options...
cjohnson202 Posted March 15, 2009 Author Share Posted March 15, 2009 hey guys, so that did work great, but the links still appear when I hit the next page buttons at the bottom. Is there any way to fix that? http://www.hockeyleaks.com I'm talking about hte little arrows at the bottom that show more posts. Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-785283 Share on other sites More sharing options...
cjohnson202 Posted March 15, 2009 Author Share Posted March 15, 2009 anyone? please? Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-785499 Share on other sites More sharing options...
kittrellbj Posted March 16, 2009 Share Posted March 16, 2009 Easiest way would be add "&page=article" to the article link code. Since it now has a $_GET['page'], the check will return true, even though page=article has no meaning beyond this. Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-785533 Share on other sites More sharing options...
cjohnson202 Posted March 16, 2009 Author Share Posted March 16, 2009 ??? where would I add the "&page=article? sorry, I'm really lost when it comes to this stuff, hense all the questions Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-785619 Share on other sites More sharing options...
cjohnson202 Posted March 17, 2009 Author Share Posted March 17, 2009 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-786645 Share on other sites More sharing options...
JonnoTheDev Posted March 17, 2009 Share Posted March 17, 2009 You need to add it to the hyperlinks for the next / prev page links i.e. http://www.hockeyleaks.com/index.php?pageNum_messages=1&totalRows_messages=195 becomes http://www.hockeyleaks.com/index.php?pageNum_messages=1&totalRows_messages=195&page=index Quote Link to comment https://forums.phpfreaks.com/topic/148622-php-help-needed/#findComment-786652 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.