AN2700 Freescale Semiconductor / Motorola, AN2700 Datasheet - Page 22

no-image

AN2700

Manufacturer Part Number
AN2700
Description
Basic Web Server Development with MC9S12NE64 and CMX-MicroNet TCP/IP Stack
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Overview of a Web Server Developed Using CMX-MicroNet TCP/IP Stack
When these web components are completed and tested, the next step is to convert them to the equivalent
CMX-MicroNet C files using CMX’s html2C utility.
Web Server index.htm HTML Source Code:
<html><head>
<SCRIPT LANGUAGE="JavaScript">
function checkInfo(form) {
var ok = true;
var valid;
var temp;
if (form.webvar.value == "")
if (ok)
{
}
}
if (ok)
{
}
if (!ok)
{
}
return (ok);
}
</SCRIPT></head>
<BODY text="#000000" vlink="#990099" alink="#990099" bgcolor="#FFFFFF" link="#0000CC"">
<CENTER><table align="center"><tr>
<td align="center" width="50%"><FONT SIZE="+1" COLOR="BLUE"><B>Enter a number between 0 and
32767 in the box below.
This will change the variable demo_var located at address 0x2000. This address can be
examined to monitor the changes to the variable.</B></FONT></td>
<td align="center" width="50%"><FONT SIZE="+1" COLOR="RED"><B>JAVA Applet</B></FONT></td>
</TR><tr>
<td align="center"><FORM NAME="var_info" ACTION="set_demo_var" METHOD=POST onSubmit="return
checkInfo(var_info)">
<INPUT NAME="webvar" TYPE="Text" MAXLENGTH=5 VALUE="<!--#exec cgi="get_demo_var"-->"><P>
<INPUT TYPE="Submit" VALUE="Update"></FORM></td>
<TD ALIGN="center" width="50%"><applet code="JavaCl.class" width="120" height="120">
</applet></TD></tr></table>
<br><br><FONT SIZE="+1"><B>Note: you must have Javascript enabled for this demo.</B></FONT>
</CENTER></body></html>
22
ok = false;
valid = "0123456789";
for (var i=0; i<5; i++)
{
temp = "" + form.webvar.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1")
var check_num = parseInt(form.webvar.value,10);
ok = (!isNaN(check_num) && (check_num >= 0) && (check_num <= 32767));
form.webvar.focus();
alert("Invalid number entered.\r\nPlease enter a number between 0 and 32767.");
return false;
ok = false;
Basic Web Server with MC9S12NE64 and CMX-MicroNet TCP/IP Stack, Rev. 0.3
Freescale Semiconductor

Related parts for AN2700