Including BASIC Code in HTTP Files

Top  Previous  Next

To create dynamic HTML pages, you include BASIC statements directly into the HTML file. A fragment of BASIC code is included within "<? ?>" encapsulation, as shown in the example below (for more info see Working with HTML):

 

 

<!DOCTYPE HTML public "-//W3C//DTD W3 HTML//EN">

<HTML>

<BODY>

 HELLO HTML WORLD!<br>

 <?

         'This is a BASIC code snippet. We can, for instance, send something to the serial port

         ser.num=0

         ser.setdata("HELLO SERIAL WORLD TOO!")

         ser.send

 ?>

</BODY>

</HTML>

 

 

Each time this HTML page will be requested by the browser, the "HELLO SERIAL WORLD TOO!" string will be sent out of the serial port.