[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference gyro::internet_toolss

Title:Internet Tools
Notice:Report ALL NETSCAPE Problems directly to [email protected].rnet? Read note 448.L for beginner information.
Moderator:teco.mro.dec.com::tecotoo.mro.dec.com::mayer
Created:Fri Jun 25 1993
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:4714
Total number of notes:40609

4482.0. "POST long string to CGI script?" by SWETSC::WESTERBACK (Panta rei) Tue Feb 18 1997 09:17

    Hi, 
    
    I wonder if someone can advise about forms and CGI.
    
    I've created a form with about 20 fields, so when sent (via POST) to 
    the CGI thew resulting string is quite long, maybe 400 chars.
    
    CGI is a DCL command procedure on a VMS 6.1 system. HTTP server
    image ident says:
    
    image name: "HTTPD_VAX"
    image file identification: "NCSA HTTPD1.3-4"
    link date/time: 16-MAR-1995 17:43:54.50
    linker identification: "05-13"
                                  
    But only the first 210 chars seems to be accepted into the linebuffer
    in the script. Any ideas how I get around this limitation?  
    
    Rgds,
    Hans
T.RTitleUserPersonal
Name
DateLines
4482.1a server upgrade is strongly suggestedLGP30::FLEISCHERwithout vision the people perish (DTN 381-0426 ZKO1-1)Tue Feb 18 1997 10:1317
re Note 4482.0 by SWETSC::WESTERBACK:

>     CGI is a DCL command procedure on a VMS 6.1 system. HTTP server
>     image ident says:
>     
>     image name: "HTTPD_VAX"
>     image file identification: "NCSA HTTPD1.3-4"
>     link date/time: 16-MAR-1995 17:43:54.50
  
        That's an old, internally ported server that never did work
        completely well.

        For VMS, both VAX and Alpha, you have your choice of two
        commercial servers, Netscape and Purveyor, and one excellent
        freeware server (the Ohio State University httpd).

        Bob
4482.2More read ?BAGELS::CHEWZh� Y�n D�Fri Feb 21 1997 10:5713
                                  
>    But only the first 210 chars seems to be accepted into the linebuffer
>    in the script. Any ideas how I get around this limitation?  
 
Due to the length limit imposed by DCL, you probably need to do multiple 
read until the EOF to get all your post data. The post data is essentially 
a data file open on the sys$input when the server invokes your DCL POST script. 

As the previous reply noted, you should use the supported servers such
as netscape and purveyor. NCSA HTTPD1.3-4 is no longer supported.

-Yoong

4482.3SWETSC::WESTERBACKPanta reiTue Feb 25 1997 16:419
    OK, I'm about to install Netscape Server, but it seems that won't help
    me in this case. I understand the point .2 is making, but I'm not quite 
    sure how to do a multiple read... Does that mean changing the way my
    HTML code for the FORM and POST is done, or is it just the CGI script?
    
    Could you clarify how this is done, maybe a short code example?
    
    Thanks,
    Hans
4482.4SWETSC::WESTERBACKPanta reiMon Mar 03 1997 10:3140
	OK, 

	I've installed Netscape Communications Server. Didn't help much:
    Now what happens is that I get a message
    
    Server Error
    This server has encountered an internal error which prevents it from
    fulfilling your request. The most likely cause is a misconfiguration. 
    Please ask the administrator to look for messages in the server's 
    error log. 
    
    Where I find:
    
    
    [03/Mar/1997:15:15:22] Node: stkeis.soo.dec.com  failure: for host
    hasse.soo.dec.com trying to POST /cgi-bin/airreq, cgi-parse-output 
    reports: the CGIprogram /$1$dka5/elsewhere/http$server/cgi-bin/airreq 
    did not produce a valid header (name without value: got line 
    "544370534cl-w-tknovf, command element is too long - shorten")
    
    [03/Mar/1997:15:15:23] Node: stkeis.soo.dec.com  catastrophe: for host
    hasse.soo.dec.com trying to POST /cgi-bin/airreq, send-cgi reports: wait 
    for CGI child failed (no children)
    
    
    I tried doing a multiple read as advised by Yoong, like this:
    
    $ read sys$input linebuffer
    $ inp_line=linebuffer
    $ read sys$input linebuffer
    $ inp_line2=linebuffer
    
    But that doesn't change anything, it seems that as soon  as sys$input 
    exceeds 255 chars it fails.
    
    Can this be done with DCL, or do I have to divide my forms into several
    shorter one? Any ideas?
    
    Rgds,
    Hans
4482.5Use AWKRDGENG::COBBGraham R. Cobb (Telecom PSC), REO1-F8, 830-3917Wed Mar 05 1997 08:0019
I don't  think you will ever get that to work using DCL as the CGI scripting
language.   DCL  just  is  not  designed  for  complex string manipulations,
particularly  of  very  long strings.  The READ command buffer limitation is
just one of the problems you will have.

If you *really* want to persevere using DCL try something like

EXCHANGE/NET SYS$INPUT: some-file.txt/FDL=some-fdl-file

where the  FDL file selects a useful file format which DCL can read in small
chunks  (hard  to know which one though, you could try Fixed length 100 byte
records  but  it  might complain if the last record is not a multiple of 100
bytes).   If  you  don't  understand  the EXCHANGE/NET command and FDL files
then really, really give up on using DCL!

I recommend  you  either  write a small C program to do what you want or use
something like AWK or TCL instead of DCL.

Graham
4482.6OK, I see...SWETSC::WESTERBACKPanta reiWed Mar 05 1997 11:4617
    Graham,
    
    thanks for replying!
    
    It's not that I love DCL so much, it's just that that's what we've got
    if we ( i.e my group) want to develop a solution (read midnight hack ;-)
    on our own. No programmers around here, but everyone knows DCL. 
    
    I'll have a look at EXCHANGE/NET, but if that's not a good way to do
    it, I'll just have to work around the issue with several forms chained
    to each other instead of one long form.
    
    Rgds,
    Hans (who'd like to learn C or Perl or something useful... but so much
    work, so little time!) 
    
    
4482.7a helper appLGP30::FLEISCHERwithout vision the people perish (DTN 381-0426 ZKO1-1)Wed Mar 05 1997 15:4622
        I wrote a simple C program for occasions where I want to do
        my script processing in DCL but DCL can't handle the string
        lengths returned by the server.

        This C program takes the result of a HTML form, sent back
        with the POST method, and depending upon the field names in
        the form either copies the decoded data directly to DCL
        symbols or creates temporary files with the field contents.

        Rather than set the DCL symbols directly, this C program
        generates a DCL program that sets the symbols -- you execute
        that program with "@" right after involving the executable.

        The C source code is:

        http://lgp30.zko.dec.com/~kits/POST-QUERY-EXTRACT-PURVEYOR.C

        The VAX executable for this is:

        http://lgp30.zko.dec.com/~kits/POST-QUERY-EXTRACT-PURVEYOR.EXE

        Bob