I don't just use plain html because i want it as a popup window...
and it's still not working properly.
What you're saying is the code shcould look like this?:
<html>
<head>
<title><? echo $valid_user ?>'s user page</title>
<link rel="stylesheet" href="league.css">
<script language="JavaScript">
function openwindow(url, headline)
{
window.open('url','headline'," toolbar=mp,location=no,directories=no,status=no,me
nubar=no,scrollbars=auto,resizable=no,copyhistory=
yes,width=500,height=300")
}
</script>
</head>
<body bgcolor=#000000>
<center><h2>Welcome, <? echo $valid_user ?></h2></center>
<table border="0" cellspacing="4" cellpadding="0" align="center">
<tr>
<td><table border="0" cellspacing="0" cellpadding="1" bgcolor="#999999" width="200" height="150">
<tr>
<td>
<table width="100%" valign="top" bgcolor="#333333" cellpadding=0 cellspacing=0 border=0 height="150">
<tr>
<td> </td>
<td valign="top"><div align="center"><font size=2 color=#999999><u>User News</u></font></div><br>
<font size="-2">
<?
$query = "SELECT id, headline, timestamp FROM usernews ORDER BY timestamp DESC LIMIT 0, 5";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0)
{
// iterate through resultset
// print article titles
while($row = mysql_fetch_object($result))
{
?>
<font size="-1" color=#666666>- <a href="javascript: openwindow('usernews.php?id=<? echo $row->id ?>', '<? echo $row->headline ?>')"><? echo $row->headline ?></a></font>
<font size="-2" color=#666666>[ <? echo formatDate($row->timestamp); ?> ]</font><br>
<?
}
}
mysql_close($connection);
?>
(I have already established my MySQL connection and al that jazz, but to save space didnt include it.