PHP Exercises
Do the following exercises in your ruby.ils.unc.edu account.
-
Write a php script that creates a three-dimensional array
called "circle" with the following data:
area circumference
1 3 6
2 12 12
3 28 18
The php script should then loop through all the keys (i.e., 1, 2, 3)
and print the area and circumference for each key.
-
Write an html page with a form with 2 fields (username and password)
and a submit button labelled "Login".
Make the username be a text field and the password be a password field.
Have the form action be to call a php script called login.php.
The php script should return a message saying "Hi username!" if the
password matches "12345". If the password does not match "12345",
then the script should print "Wrong password."
If the password is wrong, for this simple example, users will
have to use the back button on their browser to try again.
|