PHP Forms Ex. #2: Interactive Form with If-Else Statement
One very useful thing you can do with PHP is include the request for user input and the response in the same file, using conditional statements to tell PHP which one to show. For this PHP exercise, rewrite the two files of the previous exercise into one file using an if-else conditional statement.
Hint: You'll need some way to tell if the form has been submitted. The function to determine if a variable has been set and is not null is isset().
Here's the script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"