Links not updating


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to retrieving and displaying data, but if I click on a valid link in the following code, the content and links do not update like they should. All hrefs stay the same and the content does not change. Why is this?

Code: [Select]require('../scripts/chron.php');

Did you know?Explore Trending and Topic pages for more stories like this.
$con = openConnect();

// Get current entry ID, using -1 to mark an unavailable param.
$entry = (isset($_GET['id'])) ? $_GET['id'] : -1;

// Query table for vital entry info
$type = 'news';
$count = getEntryCount($type);

// Go to latest entry if param is unavailable.
if ( $entry = -1 ) $entry = $count;

// Build links for navigation
$first = $entry<=1 ? 'undef' : 0;
$prev = $entry<=1 ? 'undef' : $entry-1;
$next = $entry < $count ? $entry+1 : 'undef';
$last = $entry < $count ? $count : 'undef';

echo '<div class="newsLinks"><p>';
echo ($first != 'undef') ? ('<a href="index.php?id='.$first.'">First</a> - ') : ('First - ');
echo ($prev != 'undef') ? ('<a href="index.php?id='.$prev.'">Previous</a> - ') : ('Previous - ');
echo ($next != 'undef') ? ('<a href="index.php?id='.$next.'">Next</a> - ') : ('Next - ');
echo ($last != 'undef') ? ('<a href="index.php?id='.$last.'">Last</a>') : ('Last');
echo '</p></div>';

$row = getEntryRow($type,$entry);

// Display entry
echo '<h1 class="centerHead" id="Title">' . $row['title'] . '</h1>';
echo '<h3 class="centerHead" id="DatePosted">' . $row['datePosted']. '</h3>';
echo '<div class="newsBody" id="CurrentContent">' . $row['content'] . '</div>';
No comments posted yet

Your Answer:

Login to answer
58 Like 18 Dislike
Previous forums Next forums
Other forums

rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri

send message to the java application
Oracle 10g with Windows platform.

I have a java application that periodically pings the d

Extracting Long text from message class with parameters
Hi,

I would like to extract the long text from a message class. However, the long text ha

some query on multilingual website
Hi all,

Which is the simplest and easiest method to make a website multilingual,
is it put

Display error above the login forum help!
Hi guys. just so you know im not asking for someone to do this for me I just need to be pointed in t

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

simple php table loop
Hi all,

I've the following code

<?php // Create category options

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash