Hi,
I got the following code on my website:
<?php
$result = @('SELECT * FROM articles order by Title');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() .
'</p>');
}
while ( $row = mysql_fetch_array($result) ) {
echo '<a href="articles.php?ID=' .$row['ID'].'" target="mainFrame">'.$row["Title"].'</a><br />';
}
?>
How would I go about to run an IF-statement to check if what is inserted in the link after ?ID= is only positive whole numbers (ID uses auto_increment)? The reason I need this is because I want to avoid people trying to type in any malicious code in the include link.