[Gambas-user] CGI - Hello World

James Linden kodekrash at ...1...
Wed Nov 22 15:16:04 CET 2006


Last I checked, HTTP headers use "\r\n", not "\n"... try

PUBLIC SUB Main()
    PRINT "Content-type: text/html\r\n\r\n"
    PRINT "Hello World!"
END

Erwin Pogz wrote:
> Ok, i made some changes on my code but still doesnt work.
>  I did have a startup class.
> 
> Heres my Code:
> 
> ' Gambas module file
> 
> PUBLIC SUB Main()
>   PRINT "Content-type: text/html\n\n"
>   PRINT "Hello World!"
> END
> 
> Still doesnt work so i changed to something like this
> 
> ' Gambas module file
> 
> PUBLIC SUB Main()
>   Response.Begin
>   PRINT "Hello World"
>   Response.End
> END
> 
> Still have no luck.
> 
> 
> .. What i did is compiling my code and make an executable file as ff.gambas
> 
> if I run the ff.gambas using the console, it works fine. But when executed it as CGI using Apache. An error message is showing up:
> 
> premature end of script headers: ff.gambas
> 
> 
> The rest of my perl scrips works fine. Should I need some tweak
> in my httpd configuration?
> 
> I just upgraded my Gambas2 to 1.9.46a
> 
> 
> Best regards,
> Erwin
>  
> ---------------------------------
> Sponsored Link
> 
> $200,000 mortgage for $660/mo - 30/15 yr fixed, reduce debt, home equity -  Click now for info
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 




More information about the User mailing list