I've visited few forums to try to figure out what is wrong and how to fix this but no help so far, so I'll give it a try here.
I created a news system like a year ago, but I would like to improve it a bit.
Basically, what I want it to be like, is a table with "Subject", "Poster" and "Date".
The Subjects are links to a page named view.php which should then show the text and other information related to this subject.
So, I created a index.php which includes the stuff to get subjects from the database and give them a link to view.php, but this seemed not to work.
index.php
<table border="0">
<tr><td class="subcjet"><span><b>Subject</b></span></td><td class="header"><b>Poster</b></td><td class="header"><b>Date</b></td></tr>
<?php
require("config.php");
$ID = $_POST['ID'];
$query = mysql_query('SELECT * FROM news ORDER BY ID DESC LIMIT 10');
while($row = mysql_fetch_assoc($query))
echo '<tr><td><a href="view.php" name="ID">'.$row['Subject'].'</a></td><td>'.$row['User'].'</td><td>'.$row['Date'].'</td></tr>';
?>
view.php
<?php
require("config.php");
$ID = $_GET['ID'];
$query = mysql_query('SELECT * FROM news WHERE ID = "$ID"') or die(mysql_error());
while($row = mysql_fetch_assoc($query))
echo '<span><strong>'.$row['Subject'].'</strong> - <font size="2">Posted by '.$row['User'].' on '.$row['Date'].'</span><br /><br></font>'.str_replace(chr(10), '<br>', $row['Text']).'<hr />';
?>
I don't know if thats even a bit into the right way to do something such as this.
Basically, I've tried just to make a thing to get an ID from the Subject and show the whole row for the ID.
Any help to get this working like I am trying to would be great and I would be thankful.