Learn from sources
       star Member PERSIST01 in CGIDEV2 / DEMOHTML

 «as400»againtop           **** RESPONSE FOR REQUEST=AGAIN
 Accept-HTSession:/%HANDLE%/
 Content-type: text/html
 X-XSS-Protection: 1;
 
 «!doctype html»
 «HTML»
 «HEAD»«TITLE»Sample Persistent CGI RPG Program«/TITLE»
 «meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"»
 «meta name="DOCUMENTCOUNTRYCODE" value="it"/»
 «meta name="DOCUMENTLANGUAGECODE" value="EN"/»
 «meta name="ROBOTS" content="noindex,nofollow"/»
 «script language=javascript»
 function sbmform1(xx) {
  document.form1.request.value=xx
  document.form1.submit()
  return
 }
 «/script»
 «/head»
 «BODY TEXT="black" LINK="blue" VLINK="purple" ALINK="violet" BGCOLOR="white"»
 «TABLE WIDTH=600»«TR»«TD ALIGN=CENTER»
 «font color="blue"»«h1»Sample Persistent CGI RPG Program«/h1»«/font»
 «/TD»«/TR»
 «TR»«TD»
 «as400»again              **** RESPONSE FOR REQUEST=AGAIN
 «TR»«TD ALIGN=CENTER»
 «font face="Helvetica,Helv,Arial"»
 This is your call number
 «font color="red" size=+1»«b»   /%NUMBER%/«/b»«/font»«/font»
 «/TD»«/TR»
 «TR»«TD ALIGN=CENTER»
     «table width=200»
     «form name=form1 method=post action="/cgidev2p/persist01.pgm//%HANDLE%/"»
     «input type=hidden name=request»
     «tr»«td»
     «font face="Helvetica,Helv,Arial" size=+1»
     «input type=button value="Call again" onClick=sbmform1("runagain")»«/font»
     «/td»«td»
     «font face="Helvetica,Helv,Arial" size=+1»
     «input type=button value="Stop" onClick=sbmform1("stop")»«/font»
     «/td»«/tr»«/table»
     «/form»
 «/TD»«/TR»
 «as400»stoptop            **** RESPONSE FOR REQUEST=STOP ****
 Content-type: text/html
 
 «HTML»
 «HEAD»«TITLE»Sample Persistent CGI RPG Program«/TITLE»«/HEAD»
 
 «BODY TEXT="black" LINK="blue" VLINK="purple" ALINK="violet" BGCOLOR="white"»
 «TABLE WIDTH=600»«TR»«TD ALIGN=CENTER»
 «font color="blue"»«h1»Sample Persistent CGI RPG Program«/h1»«/font»
 «/TD»«/TR»
 «as400»stop               **** RESPONSE FOR REQUEST=STOP ****
 «TR»«TD ALIGN=CENTER»
 «font face="Helvetica,Helv,Arial"»
 You stopped calls to this program
 after call number
 «font color="red" size=+1»«b»   /%NUMBER%/«/b»«/font»«/font»
 «/TD»«/TR»
 «as400»legenda            **** LEGENDA  ****
 «TR»«TD»
 «CENTER»
 «table width=550 border=1»«tr»«td»
 This «i»persistent«/i» CGI RPG program
 defines an integer variable which is incremented
 by 1 any time you «i»call again«/i».«br»
 This variable, though its value is shown in the output html,
 is NOT sent back from the html to the program.«br»
 The «b»proof«/b» that this is a real «i»persistent«/i»
 CGI program is that this variable retains
 its preceding value when the program is called again
 (then the program increments it).
 «/td»«/tr»«/table»
 «/CENTER»
 «br»«br»
 «/TD»«/TR»
 «as400»oldos400           **** OS/400 IS TOO OLD ***
 «TR»«TD»
 «CENTER»
 «table width=550 border=1»«tr»«td»
 Sorry, persistent CGI programs can run from OS/400 Release V04R03M00 on.
 «br»This AS/400 is currently equipped with
 OS/400 Release /%OSRLS%/, therefore it cannot run this sample
 program.
 «/td»«/tr»«/table»
 «/CENTER»
 «br»«br»
 «/TD»«/TR»
 «as400»about              **** ABOUT THIS PROGRAM ****
 «TR»«TD»«br»
 «table width=580»«tr»«td»
     «font face="Helvetica,Helv,Arial"»«i»
     «A HREF="/cgidev2p/htmlmbr.pgm?cgiinp01=cgidev2&cgiinp02=demohtml&cgiinp03=persist01a"»
     About this program
     «/i»«/font»
 «/td»«td align=right»
     «font face="Helvetica,Helv,Arial"»«i»
     «A HREF="//%REFERER%/"»
     Return
     «/i»«/font»
 «/td»«/tr»«/table»
 «/TD»«/TR»
 «as400»end                **** END HTML ****
 «/TD»«/TR»«/TABLE»
 «/BODY»«/HTML»
0.015 sec.s