CGI Services

 

 

Syntax


FUNCTION CGIIN AS STRING

Description


CGIIN functions like a serial channel to the web server.  When someone accesses the web page that creates a CGI event (like a button push, or text entry) that data will be sent to a buffer that can be read from the BASIC program.

If no GET request has been made the string returned will also be an empty string. 

When the ARMweb is accessed from a web page, if the web page contains a ? in the address, data following the ? is passed to the CGIIN routine.  There is only one 256 byte buffer available, and that buffer will be available until it is read by a CGIIN, or another CGI request is made.  CGI events are only processed when the user's BASIC program is running.

This function requires version 7.36 of the firmware.

Example

dim CGIinput(255) as string
 '...

while 1
   CGIinput = CGIIN   ' assumes the form is http : // ... /Input?=#  per the example in CGI example 
 
   if CGIinput(0) then print  CGIinput  ' display on the terminal window -- for debugging
 
   select  CGIinput(6)
   case "0"
      ' do nothing
   case "1"
      io(16) = 1
   case "2"
      io(16) = 0
   end select
  '...

    CGIinput = ""   ' erase the input line 
loop


See also