HTML Haven
  -- Basics
  -- Head/Body
  -- Font
  -- Links
  -- Images
  -- Tables
  -- Forms
  -- Attributes
  -- Wizards



CGI Haven
  -- Basics
  -- Variables
  -- Adding HTML
  -- Sending EMail
  -- Flat-File Databases
  -- Validation
  -- Regular Expressions
  -- Custom Script



JavaScript Haven
  -- Basics
  -- Variables
  -- Arrays
  -- Validation
  -- Functions
  -- Loops
  -- Conditionals
  -- Windows
  -- Events
  -- Forms
  -- Extras



CGI - Variables tutorial by Matt
This section is a very short section because varibles for perl are very simple. Variables are
used to store information for later use in a program such as saving the users name or
their email address so later you can send them a friendly email. You declare a variable
by first typing $ and then typing the variable name.

$uname = $query->param('uname');

This line of code calls the param function of the CGI.pm Module. Param then gets the
value in the field labeled with a name of "uname" and adds it to the $uname variable.
I'll explain this idea better with a full example.

First open NotePad and enter the HTML form in listing 2.1

Listing 2.1
<html> <head> <title>Example 2</title> </head> <body> <form action="welcome.pl"> User Name: <input type="text" name="uname"> <input type="submit" value="Say Hi"> </form> </body> </html>
Now enter the code in Listing 2.2 into a new NotePad document

Listing 2.2
#!/usr/bin/perl use CGI; $query = new CGI; $uname = $query->param('uname'); print $query->header; print "<html>\n<head>\n<title>Welcome</title>\n</head>\n<body>\n"; print "hi, $uname!"; print "</body>\n</html>


-----------------------------------------------
This script first, as with all scripts, calls the perl interpreter
with the Shebang line. It then calls the CGI.pm module and set
a variable for it. after that it gets the value of the name
field from the form and stores it in the variable $uname.
Then we print the header for the page then the starting
html and then we finally print the message hi, and then
the value of $uname. Then we add the ending html and we are done.

Thats it for this section you now have enough knowledge
to move onto the next section Adding HTML.




Scripting Network
  -- Register
  -- Login
  -- Contact
  -- Web Board
  -- Home



Fredward Inc.
  -- Websites
  -- Programs
  -- Graphics
  -- Order
  -- .::Other::.
  -- Contact
  -- Pricing
  -- Help/FAQ
 >>Official Site