Question: 1. Write a PHP program that displays a HTML form. The form should have a text input field and a submit button. The user is
1. Write a PHP program that displays a HTML form. The form should have a text input field and a submit button. The user is requested to enter a positive number.
The program receives the number. If it is less than 1, it displays message "too small". If it is greater than 10, it displays "too large". Otherwise it outputs the following sequence
1
2
3
..
N Where N is the number the user entered.
Recommendation: Use functions.
2. Write a PHP program that connects to your database. If it succeeds, it prints "ok". If it fails, it prints "failed". Can you find out (using PHP) why it failed?
Extra point: Create a repository at github.com and submit your code (assignment 1, above) there.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
