Re: cgi question - WeOnlyDo Discussion board

Re: cgi question (General questions)

by wodSupport, Monday, January 16, 2006, 22:16 (6677 days ago) @ ricado

Thanks for pointing out, I found out bug in wodWebServer. It should be fixed now. Can you please request update for wodWebServer, or download it again if you're evaluating it.

I didn't increate major version number yet, I will do it probably on next monday.

Your code should be as it was so far, such as [code]Private Sub Http1_RequestDone(ByVal User As WODWEBSERVERCOMLib.IWebUser)
If InStr(1, User.Request.URI, cgi-bin/Chat.exe ) Then
User.Response.CGIExecute yourcgi.exe
Else
User.Response.FileName = App.Path & \index.htm
End If
End Sub[/code]
and your CGI may look, for example, like this (C sample) [code] handle = open( output.txt , O_BINARY | O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
if (handle !=(-1))
{
lseek(handle, 0, SEEK_END);
while (gets(buff))
{
write(handle, buff, strlen(buff));
write(handle, \r\n , 2);
}
}
close(handle);

puts( Content-Type: text/html );
puts( );
printf( Done!\r\n , total);
[/code]

Let me know how it goes with new version

Kreso


Complete thread: