I wish to check if a unique ID submitted from a HTML form is existing in the database, if yes, then I continue to provide service, so here is my code:-
However, it can't work properly, wrong IPs can still continue, any hints?
I do not want to code the scripts something like:-
I hope you understand what I'm talking about
Thanks in advance!
PHP:
...
$sql = "SELECT * FROM Project WHERE id='$id'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
if (!eregi("$row[id]", $id)) {
DisplayErrMsg("Error : You have enter a wrong ID number!");
exit();
}
}
...
However, it can't work properly, wrong IPs can still continue, any hints?
I do not want to code the scripts something like:-
PHP:
if (eregi("$row[id]", $id)) {
echo "Provide Service, PHP code here...";
exit();
}
I hope you understand what I'm talking about
Thanks in advance!