CGI Library for Blitzmax

BlitzMax Forums/BlitzMax Programming/CGI Library for Blitzmax

Scaremonger(Posted 2007) [#1]
I've just published on my website a CGI library for creating web based applications.

I have tested it under IIS6 on Windows server 2000 and Personal Web server under XP Pro, and it works well.

It supports RFC Compliant Request and Response object types. It supports Forms, Querystrings, Server variables, Cookies and even supports a Session ID.

The session ID is useful, in that it allows you to save state data from one user request to the next; and therefore create proper applications.

It can be downloaded from www.itspeedway.net.

An example application is listed below to give you some idea on how easy it is to create web-applets...

index.html
<HTML>
<HEAD><TITLE>Testing ITSCGI-test.exe</TITLE></HEAD>
<BODY>
Call the EXE using a querystring: <a href='CGI_BIN\ITSCGI-test.exe?name=its&fn=xyz'>Click here</a><br>
<br>
Or Try this form:<br>
<br>

<FORM action='/cgi_bin/ITSCGI-test.exe' Method='POST'>
Name: <Input Type='TEXT' NAME='Name'><br>
<Input Type='SUBMIT'>
</FORM>

</BODY></HTML>

ITSCGI-test.exe - You need my modules to compile this.
Include "ITSCGI.bmx"

response.write "<html><body>"

response.write "<b>REQUEST METHOD:</b> " + request.serverVariable( "REQUEST_METHOD" ) + "<br>"
response.write "<b>CONTENT_TYPE:</b> " + request.serverVariable( "CONTENT_TYPE" ) + "<br>"

' Obtain Form / Querystring argument
response.write "<b>Name:</b> " + request.get( "Name", "N/a" ) + "<br>"
response.write "<br>"

response.write "</body></html>"


The whole module library is documented, just run docMods to integrate them into your IDE.

Let me know what you think and if you want anything added, let me know. I intend to improve the cookie and session support at a later date and also include SOAP-server examples.


alligator(Posted 2007) [#2]
hmm... getting a 500 Internal Server Error when trying to dowload any of the files.

sounds interesting.. is it designed specifically for Windose or is the src code generic enough to compile & work on linux?


CodeGit(Posted 2007) [#3]
I would really like to try this but unfortunately your download site has errors. :(


Scaremonger(Posted 2007) [#4]
Oops. Thats a bit weird..

I designed it with Windows in mind, but the code is pure Blitzmax so it might work on other web servers.

I don't have any others web servers to try it on, but I'd love to hear how it goes.

Edit: 22:17 GMT
The error on my server has been fixed (Hopefully)