Squalls_dreams Posted November 24, 2006 Share Posted November 24, 2006 hello..I have this coding that helps with my navigation and my news.The problem is my important news keeps showing up when I click on a link. I dont want my important news to keep showing up on every page. My plane news doesnt appear which is good, I only want my important news to show up on my index page like my plane news so I wont have to keep seeing it on every page. How can I do this?this is what my coding is.[quote]<B>Important News</B><?$number = "1";$category = "4";$template = "important";include("nfnews/show_news.php");?><br/><B>Normal News</B><?$val = $_GET['nfn'];$val .= ".php";$dirty = array("..");$clean = array("");$val = str_replace($dirty, $clean, $val);if (isset($_GET['nfn'])) { if (file_exists($val)) { include "$val";}else {include "index.php"; }}else {$number = "3";$show_calendar = true;include "nfnews/show_news.php";}?>[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/28355-php-navigation-with-news/ Share on other sites More sharing options...
Ninjakreborn Posted November 25, 2006 Share Posted November 25, 2006 This doesn't really make sense to me, it's heavily malformedI prefer id has weight:bold;<span id="news">Important News</span><?php$number = "1";$category = "4";$template = "important";include("nfnews/show_news.php");?><B>Normal News</B><?php$val = $_GET['nfn'];$val .= ".php";$dirty = array("..");$clean = array("");$val = str_replace($dirty, $clean, $val);if (isset($_GET['nfn'])) {if (file_exists($val)) {include "$val";}else {include "index.php";}}else {$number = "3";$show_calendar = true;include "nfnews/show_news.php";}?>Now that it's where I can read it, let's see about what we can do.$number = "3";it should be$number = 3;All of those numbers shouldn't be turned to a string, that could be part of it.Trying cleaning it up as shown (so I can read it to help), and try changin those, when you put "3" you are telling php that 3 is a string, it may need to be a number for what you are trying to do. Try that first. Quote Link to comment https://forums.phpfreaks.com/topic/28355-php-navigation-with-news/#findComment-129831 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.