Hi all,
I have one webpage in which people can order books online. ( basically text box )
i have one array - book , in which i have stored all different types of books.
Now, I dont want the user to order any garbage ( just numerical entry and not alphabetics ) .
How can I do so ??
I have used following code , but dint work proper
if(isset($_POST['books']) ) {
$input = $_POST['books'];
foreach($input as $input1)
{
if(!(ereg("^[0-9]+$",$input1))) die ('Please enter numeric values ') ;
}
}
in Above , I want to check for all the entries of books , whether the value entered is numeric or not....
But I guess I am not populating array properly , So how can I do so ??