next up previous Return to CLIP Main Page
Next: Accessing WWW/Internet documents from Up: Document: pillow_sl_imperial Previous: Combining the Form Producer

A Phones Database

main(_) :-
        get_form_input(Input),
        get_form_value(Input,person_name,Name),
        response(Name,Response),
        output_html([
          cgi_reply,
          start,
          title('Simple CLIP telephone database'),
          center( [ 
            image('http://localhost/images/clip.gif'),
            heading(2,'Simple CLIP telephone database'),
            --,
            Response,
            start_form,
            'Click here, enter name of clip member, 
            and press Return:', 
            \\,
            input(text,[name=person_name,size=20]),
            --,
            end_form,
            image('http://localhost/images/pillow_d.gif') ]),
          end ]).

response(Name, []) :- form_empty_value(Name), !.
response(Name, 
         ['Phone number for ', bf(Name), ' is ', Info, --]) :-
         phone(Name,Info), !.
response(Name, 
         ['No phone number available for ', bf(Name), '.', --]).

%% Database
phone('CLIP',   '336-7448').
phone('Paco',   '554-5225').
phone('Daniel', '460-0569').



<herme@fi.upm.es>-< webmaster@clip.dia.fi.upm.es>
Last updated on Mon Mar 31 20:49:44 MET DST 1997