Jump to content

php navigation with news


Squalls_dreams

Recommended Posts

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]
Link to comment
https://forums.phpfreaks.com/topic/28355-php-navigation-with-news/
Share on other sites

This doesn't really make sense to me, it's heavily malformed
I 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.