- Index
FUNCTION PBMAIN() i = 1 a$ = ENVIRON$("CGI_STDOUT") OPEN a$ FOR OUTPUT ACCESS WRITE AS #3 ' Open outputbestand PRINT #3, "<html><body><pre>" a$ = ENVIRON$(1) WHILE a$ <> "" ' print de volledige ENVIRONMENT PRINT #3, a$ INCR i a$ = ENVIRON$(i) WEND PRINT #3, "<hr>" OPEN ENVIRON$("CGI_STDIN") FOR BINARY ACCESS READ SHARED AS #1 GET$ #1, LOF(1), a$: CLOSE #1 ' Printout van het inputbestand, dat soms nodig kan PRINT #3, a$ "</pre>" ' zijn bij de verwerking van TEXTAREA in PRINT #3, "</body></html>" ' formulieren CLOSE END FUNCTION |
<html><body> <form ACTION="/cgi-bin/env.exe" method="POST"> <p>Vul de gegevens in: <table border=1> <tr><td width=50%>Naam:<td width=50%><input type=text size=20 maxlength=256 name="Name"> <tr><td width=50%>Is deze site interessant?<td width=50%><select name="LikeFactor" size=1> <option value="Enorm">Enorm</option> <option value="Redelijk">Redelijk</option> <option value="Niets speciaals">Niets speciaals</option> <option value="no comment">no comment</option> <option value="Ik begrijp er niets van">Ik begrijp er niets van</option> </select> <tr><td>Welke browser gebruik je?</td><td><input type=radio name="BrowserType" value="IE">Internet Explorer <input type=radio checked name="BrowserType" value="Mozilla">Mozilla <input type=radio name="BrowserType" value="Andere">Andere <tr><td>Wenst u gecontacteerd te worden? <td><input type=checkbox name="Contact" value="ON" checked>Ja! <tr><td>Opmerkingen:<td><textarea name="Opmerkingen" rows=2 cols=20></textarea> </table> <input type=submit name="Submit" value="Verzenden"> <input type=reset name="Reset" value="Reset"> </form> </body></html> |
... OPEN ENVIRON$("CGI_STDIN") FOR BINARY ACCESS READ AS #1 GET$ #1, LOF(1), a$: CLOSE #1 name$ = unescape$(a$, "Name") remarks$ = unescape$(a$, "Remarks") .... FUNCTION unescape$(a$, key$) STATIC c$ = "" j = PARSECOUNT(a$, "&"): k = LEN(key$) FOR i = 1 TO j b$ = PARSE$(a$, "&", i) IF LEFT$(b$, k) = key$ THEN b$ = REMAIN$(l + 1, b$, "="): k = LEN(b$) FOR j = 1 TO k d$ = MID$(b$, j, 1) IF d$ = "%" then c$ = c$ + CHR$(VAL("&H" + MID$(b$, j + 1, 2))) j = j + 2 ELSE c$ = c$ + d$ END IF NEXT j unescape$ = c$ EXIT FUNCTION END IF NEXT i END FUNCTION |
Individuele landingspage bezoekers: