August 2003
Intermediate to advanced
1104 pages
19h 27m
English
Manipulating variables that you set within your script is somewhat interesting, but hardly anything to rave about. Scripts become much more useful when they use input from the user. When you call PHP from an HTML form, the form fields are turned into variables. Listing 1.9 is a form that calls Listing 1.10, a further modification of our example script.
<html> <head> <title>Listing 1-9</title> </head> <body> <form action="1-10.php" method="post"> Your name: <input type="text" name="YourName"><br> Cost of a lunch: <input type="text" name="CostOfLunch"><br> Days buying lunch: <input type="text" name="DaysBuyingLunch"><br> <input type="submit" value="Compute"> </form> </body> ... |
Read now
Unlock full access