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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!