PB/CC - CGI form variable verify 
Author Message
 PB/CC - CGI form variable verify

Please add this function to your "PBCGI.INC" file.  It will check a form for
required fields:

' example
IF cgiRequired(cgi, "name,company,address,phone,email") THEN
  ' Success!
ELSE
  cgiWrite "You forgot to fill out a required field"
END IF

FUNCTION cgiRequired(BYVAL cgiInput AS STRING, BYVAL requiredFields AS
STRING) AS LONG

  LOCAL x AS LONG
  LOCAL f AS STRING

  FOR x = 1 TO PARSECOUNT(requiredFields)
    f = PARSE$(requiredFields, x)
    IF ISFALSE LEN(cgiParam(cgiInput, f)) THEN
      EXIT FUNCTION
    END IF
  NEXT x

  FUNCTION = -1

END FUNCTION

--Dave



Sun, 08 Feb 2004 22:06:43 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CGI programming in PB/CC

2. PB/CC debugger and array variables

3. MX Lookup with PB/CC or PB/DLL

4. TCPADDR for PB/DLL & PB/CC

5. Info on new PB/CC and PB/DLL

6. Announcing the JazzAge COM Wizard for PB/DLL and PB/CC

7. animated characters, speech input/output in PB/DLL and PB/CC

8. email enable PB/DLL-PB/CC using Outlook

9. SQL, ADO/OLE-DB programming in PB/DLL and PB/CC

10. Tcl CGI not showing variables values from form?

11. NUL device not working in PB/CC?

12. dir_trav.bas pb/cc 2.11 directory traverse program

 

 
Powered by phpBB® Forum Software