Now I can make a prolog script for html in cgi-bin, but I have trouble when I want to use Pillow.
I'm using Ciao-1.4 under Linux.
I have run the make file as instructed in the README and then I try to make the example like this :
---------------------------------------------
#!/bin/sh exec /usr/local/bin/ciao-shell $0 "$@" # -*- mode: ciao; -*-
:- use_module('/usr/local/lib/ciao/ciao-1.4/library/pillow/pillow.pl').
main(_) :- get_form_input(Input), get_form_value(Input,person_name,Name), response(Name,Response), output_html([ 'Content-type: text/html', html([title('Telephone database'), img$[src='/images/redball.gif'), h2('Telephone Database'), hr$[], Response)]).
response(Name, Response) :- form_empty_value(Name) -> Response = 'You have to provide a name.' ; phone(Name, Phone) -> Response = ['Telephone number of ',b(Name),': ',Phone] ; Response = ['No telephone number avalaible for ',b(Name),'.'].
phone(daniel, '336-7448'). phone(manuel, '336-7435'). phone(sacha, '543-5316').
------------------------------------------------
When I try to access the cgi script via a browser I get an Internal Server Error.
When I tried to run from shell prompt, I found several error like this :
------------------------------------------------
ERROR: (lns 5-16) syntax error :, | or ] expected in list main(_) :- get_form_input(Input), get_form_value(Input, person_name, Name), response(Name, Response), output_html([Content-type:text/html, html([title(Telephone Database), img$[src=/images/redball.gif), h2(Telephone Database),hr$[],Response)]) ERROR : Source used as module without module declaration {ERROR : user : main/1 - undefined predicate}
------------------------------------------------
What is the problem ?
Regards
Wahju
Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com