I Have scipt called headlines.php and in that script I have a variable set in an URL inside it like http://localhost/npublisher/readnews.php?id=$id. when i click the link the variable id is empty. The readnews.php does not have functions. It is simple scripts that reads news from database useing $id but that is empty. What could be the problem? the readnews.pho script is
Please help
<?php
include("dbconfig.php");
require("functions.php");
if ( !$connlink ) die( "Couldn't connect to MySQL" );
echo("<p><b>787 am here... $id --</b></p>");
if (!$id == ""){
$res = mysql_query("SELECT * FROM news_contents where n_id = '$id'", $connlink);
echo("<br/>");
echo("<table border='1' width='45%' cellpadding='0' cellspacing='0'>\n");
echo("<tr bgcolor='#CCCCCC'>");
echo("<td><b>IDs: </b></td>");
echo("<td><b>News: </b></td>");
//echo("<td><b>TimeStamp: </b></td>");
echo("</tr>");
echo("<tr>");
while ($row = mysql_fetch_array($res)) {
$n_id = $row["n_id"];
$news = $row["news"];
echo("<td>".$n_id."</td>");
echo("<td>$news</td>");
//echo("<td>$t_stamp</td>");
echo("</tr>");
}
echo("</table>");
}
echo("</body>");
echo("</html>");
?>if while