HTML Web forms interface to NU-Prolog


*** Our system administrators change our WWW hardware/software occasionally without letting me know. If this system doesn't work please email me.

HTML has a form facility with quite a few neato features. There is a Common Gateway Interface (CGI) defined between these forms and other code. Perl is a common language for interfacing with forms; C is sometimes used also. Here is some code which interfaces NU-Prolog with HTML forms. I should add the disclaimer that I don't know much about HTML or CGI. I'm probably doing some things the "wrong" way, but nevertheless, it works!


Check out this form which illustrates most of the features of HTML forms. You fill in the form, hit the "Submit Form" button and another page pops up. What creates that page? This NU-Prolog program.

How is the connection specified? The form specifies that the ACTION is "http://www.cs.mu.oz.au/us/cgi-bin/nptest". This is the file produced by compiling the program above using the NU-Prolog compiler nc. The compiler output must be very slightly modified for the interface to work properly - see the comment in the file.

Manuel Hermenegildo has also done some related work with Sicstus Prolog and developed the PiLLoW library. Actually, lots of people have now done this kind of thing - there have been ICLP conference workshops on WWW and I'm sure they will continue.



Lee