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');
$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
18
Other forums
cURL proxy
Okay here is the thing... i know how to add proxys
Code: curl_setopt($ch, CURLOPT_PROXYTYPE,
Logging and nologging bulk insert
Hi,
oracle version: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
Opening Multiple Files/Links in Order.
I want to open links in order/one-by-one and check each for a specific string.
Example:
I
Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c
Which practice of iteration through containers is preferred
In the "real world" what kind of loop do most people use to iterate through a container like a vecto
Need help with some php code :)
Hey! I'm quite new to this whole thing, so please don't fire me with shait on this one =D
I'm
List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab
php slowing my site?
Hi all,
I think that one of the reasons that my site doesn't work fast is that the code is ve
array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e
need help to creat database
Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i w