I’m using: SWI-Prolog version 7.6.4
I am having a problem to create webpage consists of hyperlinks which link to other webpages using Prolog.
So far, I able to do this:
:- use_module(library(http/http_parameters)).
:- http_handler(root(test), web_form, []).
server(Port) :-
http_server(http_dispatch, [port(Port)]).
web_form(_Request) :-
reply_html_page(
[title('e-TEST')],
[
form([action='/landing', method='POST'], [
p([], [
label([for=name],'Please select: '),
input([name=test, type=radio, value="one"]),"TEST 1",
input([name=test, type=radio, value="two"]),"TEST 2"
]),
p([], input([name=submit, type=submit, value='Submit'], []))
])]).
:- http_handler(root(landing), user_input, []).
user_input(Request):-
http_parameters(Request,
[ test(Input, [])
]),
format('Content-type: text/html~n~n', []),
format('<table border=1>', []),
format('<tr>', []),
format('<td>', []),write("Your Input"),nl,format('</td>', []),
format('<td>', []),format('<b>', []),write(Input),nl,format('</b>', []),format('</td>', []),
format('</tr>', []),
format('</table>', []).
However, I can’t create a simple hyperlink using Prolog in the above webpage.
I want to create a MainPage in the web browser - which divided into 2 frames.
The first frame consists of hyperlinks and the second frame is the target to upload the webpage.
I shared the HTML codes below.
I did this all these in HTML using framesets.
Is it possible to create these using Prolog?
mainpage.htm
<html>
<head>
<title>FOREST MANAGEMENT</title>
</head>
<frameset cols="20%,*">
<frame name="one" src="hyperlinks.htm"/>
<frame name="TARGETFRAME" src="resources.htm"/>
</frameset>
</html>
hyperlinks.htm
<html>
<body>
<h3> F - O - R - M - A - G </h3>
<ul>
<li><p><a href="resources.htm" target="TARGETFRAME"> RESOURCES </a></p></li>
<li><p><a href="calculated.htm" target="TARGETFRAME"> CALCULATED </a></p></li>
<li><p><a href="damages.htm" target="TARGETFRAME"> DAMAGES </a></p></li>
</ul>
</body>
</html>
resources.htm
<html>
<body>
<h1>PRE-FELLING INVENTORY</h1>
</body>
</html>
calculated.htm
<html>
<body>
<ul>
<li><h1>VALUE</h1></li>
<li><h1>VOLUME</h1></li>
<li><h1>PRODUCTION</h1></li>
</ul>
</body>
</html>
damages.htm
<html>
<body>
<ul>
<li><h1>FOREST FLOOR</h1></li>
<li><h1>RIVER</h1></li>
<li><h1>RESIDUAL TREES</h1></li>
</ul>
</body>
</html>