MDK-ARM Keil, MDK-ARM Datasheet - Page 83

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Getting Started: Building Applications with RL-ARM
An HTML file that is intended to output a dynamically changing greeting
message to the web browser would look like this:
t
t
c a
t
t
.
The first two lines begin with the “t” script command. This means that the
remainder of the line is HTML and will be sent to the client browser. The third
line begins with the “c” script command. This means it is a command line. The
remainder of the line will be passed in an environment variable to the common
gateway interface function cgi_func(). The environment variable is called env
and from the example above it will contain the string “a <p>%s</p>”. The
start of this string consists of user defined control characters, in this case the “a”.
The cgi_func() must contain code to parse these characters and then format the
remainder of the HTML line.
U16 cgi_func (U8 *env, U8 *buf, U16 buflen, U32 *pcgi)
}
In the case above when the page is loaded, the “a” clause of the switch statement
will be executed. The sprint() statement then becomes
len = sprintf ((S8 *) buf, <p>%s</p> , "Hello World");
and the contents of buf becomes:
<p> Hello World </p>
which is then output to the browser.
To the browser the HTML code will appear as shown below.
<HTML><HEAD><TITLE>Hello World</TITLE></HEAD>
<BODY>
<H2 ALIGN=CENTER>Output a Greeting as Dynamic HTML</H2>
<p> Hello World </p>
</BODY>
switch (env [0])
}
return ((U16) len);
case 'a':
len = sprintf ((S8 *) buf, (const S8 *) &env [2], "Hello World");
break;
<HTML><HEAD><TITLE> Hello World Example </TITLE></HEAD>
<H2 ALIGN=CENTER> Output a Greeting as Dynamic HTML </H2>
<p> %s </p>
</BODY>
</HTML>
{
# The period marks the end of the file
{
83

Related parts for MDK-ARM