I get this error
Notice: Use of undefined constant id - assumed 'id' in f:\apatche\apache\htdocs\deletenews.php on line 5
I have this code in a function which I call to display\format all my news files.
$id=$FileList[$FileCount]; // Stores name of the news file
// Print our news entry then return to loop and prin the next.
print ("
<table width=\"98%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\" class=\"tableb\">
<tr>
<td width=\"74%\" class=\"Text01\"><B>$NewsEntry[0]</B></td>
<td width=\"26%\" class=\"Text01\"><div align=\"right\">$NewsEntry[2]</div></td>
</tr>
<tr>
<td colspan=\"2\" class=\"Text01\"> <div align=\"justify\">$NewsMessage</div><BR><a href=\"DeleteNews.php?id=$id\" class=\"Link01\">Delete</a></td>
</tr>
</table>
<hr size=\"1\" class=\"Link01\" />
");
Along with printing the news details it also prints the URL to delete the file:
<a href=\"DeleteNews.php?id=$id\" class=\"Link01\">Delete</a>
the id is the name of the file stored on the server.
This is passed to another page called deletenews.php and this is the code for that page.
<?php
$FileID=$_GET[id];
print $FileID;
?>
Just displays the filename, for text purposes, which is does correctly but not before giving the above error. Im not sure where\how to define the "id" variable it askes me too.
.. any ideas? I guessing its a problem with calling the new php page from a function. 😕