Microsoft Word - Sam's Teach Yourself MySQL in 21 Days - SAMS.doc

(singke) #1




Please describe yourself:<font size="4" face="Arial">
<font color="#FF0000">*</font></font></P>
<BLOCKQUOTE>
<TABLE>
<TR>
<TD ALIGN="right">
<EM>Age</EM></TD>
<TD>

<INPUT NAME="Personal_Age" SIZE=3 MAXLENGTH=2>
</TD>
</TR>
--------------- Code Continues ---------
Most of the code from this page was left out because I wanted you to see how data from this form would
be passed to the next. This is a regular HTML page. It contains a form and a series of elements within
the form. The first line of the code listing is the form tag. Form tags have a GET and POST method. You
are using the POST method here. The POST method will post all the elements of this form in
name=value pairs with your request for the next page, which is noted in the ACTION section of the tag.
You are requesting the PoatAd.asp page. After the Submit button is clicked, the browser will send the
variable and request the PostAd.asp page.
The rest of the code segment shows an element of the form. Each element is designated the <INPUT>
tag, and each element has a name. This name will be paired up with the value the user provides in the
element. For example, the user enters his or her name in the first box on the form. In the HTML code,
you see that the first element is called Contact_FirstName. This name will be paired up with
whatever the user entered in this field. So, if the user entered Larry into the box, the name=value pair
that would be passed to the server would be Contact_FirstName=Larry.

Posting an Ad


The more interesting code happens on the next page. First take a look at the entire code in Listing 13.3 for
the PostAd.asp page. You will then walk through, line-by-line, and examine what is happening.
Listing 13.3 Posting an Ad on a Web Page


10 <%@ Language=VBScript %>


20


30


40


50 <%


60 'Variable Declaration


70 Dim mCmd


80 Dim mConn

Free download pdf