Question
Part 1: Form Validation Create an HTML form to receive any number from a user. Write a PHP script to validate if the user entered
Part 1: Form Validation
Create an HTML form to receive any number from a user. Write a PHP script to validate if the user entered a number. If the entered value is not a number, ask the user to go back to the form and enter a number again. If the user entered a number, the PHP script should show if the number is less than 10 or greater than or equal to 10.
Create a number_form.html file using text editor (NotePad++ or other). Your number_form.html should include a text input box to receive a number from the user.
It should include one text input box.
The value entered into the box should be sent to form_validation.php
Create a form_validation.php file.
It should validate if a number value was transferred from the HTML. For validation, you should use the !empty()function and the is_numeric() function together in the if-statement.
If the transferred value is not a number, print out Please go back and enter a number.
If the transferred value is a number, print it out using a variable.
Then, use another if-statement to check if the transferred number is less than 10. If the transferred number is less than 10, print out Your number is less than 10. Otherwise, print out Your number is greater or equal to 10.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started