Problem with CGI library

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tecor400.

Hi,
I'm writting a CGI program using CGI library from "wavemaker", downloaded from resources site.

If I call it from MS-DOS, it works fine. But if I use it in cgi-bin folder calling from browser, it hangs (no response, no activity) at function StdIN(0) (or StdIN(MemoryBuffer)) when it receives POST data.

what I can do?
Best Regards
Joaquin
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Hi, I coded that library, but I'm not at home this week and I won't be able to deal with that problem until next week, sorry. I'll get into it then. In the meanwhile, could you send me the code that produces the bug?

See you soon,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tecor400.

Hola,

Dim field.s(valuepairsnumber)
Dim value.s(valuepairsnumber)
Dim decodedvalue.s(valuepairsnumber)

yourbrowser.s = GetEnv("HTTP_USER_AGENT")
StdOut("Content-type: text/html" + Chr(10) + Chr(13) + Chr(10) + Chr(13))
StdOut("Your browser is " + yourbrowser + "")

metodo.s = GetEnv("REQUEST_METHOD")
StdOut("Metodo: "+metodo+".")
longi.s = GetEnv("CONTENT_LENGTH")
StdOut("Longitud: "+longi+".")

inputdata.s = ""
Select UCase(metodo)
Case "POST" : inputdata = StdIn(0) ; ")

For i=0 To (valuepairsnumber-1)

field(i) = StdInSplit(i, 0, inputdata)
value(i) = StdInSplit(i, 1, inputdata)
decodedvalue(i) = URLDecode(value(i))

StdOut(field(i) + ": " + decodedvalue(i) + "")

Next i

StdOut("")

End

STDOUT runs OK.
My WebServer is SimpleServer (http://www.analogx.com)
My Browser is MS IE 6sp1

For detailed information (in spanish) use [url]mailto:tecor400@hotmail.com[/url]

Best Regards
Joaquin
Post Reply