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
What is the problem ?
Regards
Wahju
one of the possible problems is that your prolog code is syntacticaly incorrect
for one, the line : img$[src='/images/redball.gif'), is feeling very poorly
people using scripts should consider testing their prolog code before adding the unix directives (top two lines of the posted code)
just consult it, and query with main(somelistofatoms).
regards
nicos.
Appart from the good remark of Nicos, you should use
:- use_package(pillow).
instead of
:- use_module('/usr/local/lib/ciao/ciao-1.4/library/pillow/pillow.pl').
(the README is a bit obsolete for the Ciao version of PiLLoW)