I would use a javascript that listens for clicks on article links. You would have to make each article link of class='article' or something common to all articles so that the javascript could distinguisth the link. Then have the javascript POST or Get the name of the article to the same PHP page. Basically, make it so you have a $POST['ARTICLE'] = article_name when you return to the page. If the $POST['ARTICLE'] variable is set then use a query and a function to display the article.
Here is my Idea. I'll try to get back with the javascript. I need to write something like this for one of my projects.
example:
<html>
<head>
<title>List of John's United Articles</title>
<script language = "javascript">
// I don't know much java script so it's just a skelaton
getArticle ( alink ) {
if ( alink.class = 'article' ) {
// write an invisible form ( action="current php page" method = "post" )
// ( invisible input with name = ARTICLE and value)
// ( value set to your article name )
// use form_name.submit() // this will bring you back to the
}
else (
//navagate to alink
}
}
getArticle = onClick( href );
</script>
</Head>
<body>
<?php
//ESTABLISH A CONNECTION
$dbcnx = @mysql_connect('localhost','root','');
if(!$dbcnx){
echo('<p>Unable to connect to the database!</p>' );
exit();
}
//SELECT A DATABASE
if(! @mysql_select_db('osheaarticles')) {
die( '<p>Unable to locate the "osheaarticles" database!</p>' );
}
?>
<p> Here are all the united articles in the database </p>
<blockquote>
<?php
//SEND SQL QUERY
// check if user already selected an article
if ( !isset( $_POST('ARTICLE') {
$results = @('SELECT title FROM unitedarticles');
if(!$results) {
die('<p> Error performing "title FROM unitedarticles" query: '.mysql_error().'</p>');
}
while ( $row = mysql_fetch_array($results)) {
echo('<ul>'.$row['title'].'</ul>');
}
}
// user has already selected an article
else {
displayArticle( $_POST('ARTICLE') );
}
function displayArticle( $article ) {
// mySql query
// display formating
}
?>
</blockquote>
</body>
</html>