For the first time I used PHP for input verification in PHP, I used PHP as an online bookstore. during background management, the administrator entered the basic information of the book in the HTML form, how can I verify the input information. For example, the number of pages in a book must be an integer, but an error may occur when you enter text or other words. I want to use a regular expression, but I don't know how to write it. ------ Solution -------------------- js is ready ------ solution -------- about the input verification in PHP
For the first time, I used PHP as an online bookstore. during background management, the administrator entered the basic information of the book in the HTML form. how can I verify the input information. For example, the number of pages in a book must be an integer, but an error may occur when you enter text or other words. I want to use a regular expression, but I don't know how to write it.
------ Solution --------------------
Js.
------ Solution --------------------
Verify the JavaScript code once and submit the php page again.
If (isnumeric (number submitted ))
{
........
}
Else
Echo 'error occurred ';
------ Solution --------------------
Use regular expression to judge js
------ Solution --------------------
The next upstairs program.
If (is_int (submitted numeric variable )){
........
}
Else
Echo 'error occurred ';
------ Solution --------------------
I will not learn about JS.
How can I do this without learning?