8.4.2 User Input - Continued

We entered some text, submitted the form, and our browser now shows this:

Netscape: Untitled

File Edit View Go Communicator
Location:
Enter some text:

You entered: Jack & Jill

What happened was:

  1. We submitted the form, with the <INPUT> tag txt set to Jack nbsp;& nbsp;Jill . Vortex automatically copies any form data - GET as well as POST - to Vortex variables of the same name. So our $txt variable is set to Jack nbsp;& nbsp;Jill .

  2. main prints the form - pre-filled with our submitted text because $txt is set.

  3. The main function ends, and the script ends.

HTML escapement

An important feature to note here is that we entered data that needs HTML escapement when printed - the ampersand (& ). Vortex automatically HTML escapes variables when they're printed, so we don't need to worry about it. (We can verify this by looking at the HTML source in our browser - the & is shown as &amp; .)

Back: User Input - Continued Next: Variable Manipulation
Copyright © 2024 Thunderstone Software LLC. All rights reserved.