package webconsole , homepage with form field , hyperlink call a predicate
OnkelBums <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hello,
ich need help to finish my webserver on SWI-Prolog.
I use the package webconsole
http://www.swi-prolog.org/pack/list?p=webconsole .
The code from webconsole.pl:
% wc_server(Port) :-
% wc_option(port(Port), _),
% http_server(http_dispatch, [port(Port),workers(5),timeout(30)]).
%
% wc_server(Port) :-
% http_server_property(Port, goal(_)), !.
%
% wc_browser(Port) :-
% http_link_to_id(wc_home, [], Home),
% format(atom(URL), 'http://localhost:~w~w', [Port, Home]),
% www_open_url(URL).
%
% %% wc_home(+Request) is det.
% %
HTTP Handler for the default webconsole console layout
%
% wc_home(Request) :-
% wc_allowed(Request),
% wc_option(title(Title), 'SWI-Prolog webconsole'),
%
% reply_html_page(title(Title),
% [ \html_requires(css('webconsole.css')),
% h1(Title),
% \wc_error_area,
% \wc_output_area([]),
% \wc_form_area([])
% ]),
% wc_html(['Hello old']).
I start the server for example with this command:
% wc_start([title('Prolog-WebApp'),port(80),allow(_)]). or I do the :- at
first an compile
Now I get a input field when I type this at the prolog promt:
% inputNumber(Nr,Count).
% definition
inputNumber(Nr,Count) :-
wc_ask(
[ inputNumber(Nr, between(1,Count)) ],
[ p(['Gebe eine Nummer ein: ', input([name(inputNumber)])])
]).
I want to build an automatic web server without manual help. later it shut
be work on my linux server and shut be able for everyone else
(multithreading several requests).
My problem is to get the input field on the homepage (wc_home) without type
something in the prolog promt. Any ideas?
My offer is to call the predicate "inputNumber(Nr,Count)" at homepage but I
have not the skills. Another idea is to create a hyperlink and call the
predicate too.
Maby its an stupid question but I dont get it.
Thanks Onkel
--
View this message in context: http://swi-prolog.996271.n3.nabble.com/package-webconsole-homepage-with-form-field-hyperlink-call-a-predicate-tp12852.html
Sent from the SWI Prolog mailing list archive at Nabble.com.