What is your name?

"; // Some output so we can monitor the value of $myname print "

Your name is $myname

"; /* Comments/Explanation We first create a local variable called $myname and assign it the value of whatever submitted data has a variable name of "myname" The first time we visit this page, there is no submitted variable called "myname". As a result, the print statement 'your name is $myname' does not print an actual name. Once we've typed in a name, however, then pressing submit actually forwards the following data pairing to the server: myname=value which the PHP script can then read ($myname = $_POST['myname'];) and assign to a local variable called $myname. Notice that we now use substitution to print the name. We treat it as a variable that was assigned a real value. Notice also the trick in the text input field: VALUE=\"$myname\" This is an example of "sticky forms." We substitute real variable values into the form fields. This will be helpful later for form validation so people don't have to retype things they've already typed. */ ?>