Hello World (from a link)

Try online Examples

Now we are into the web!!
People rarely think of calling scripts from a link, rather than from a form. It's a useful thing to keep in mind and here's how to do it! Only caveat is, some servers will not accept a lot of data this way. 200 characters is about the maximum length your URL should be, to be on the safe side.

Here's how we did it:

<A href="/cgi-bin/aptilis.exe?file=/home/scripts/hello2.e.txt">Hello?</A>

And now, the Aptilis programme, saved as 'hello2.e.txt'

sub main

	print("Content-type: text/plain\n\n")
	print("Hello World!")

end main

Note that the link should be something like http://www.a_company.com/cgi-bin/etc... but I am using what's called a relative link, or a link that's relative to the current URL of the HTML page currently on the browser. I do that because I first try those pages at home, where I have Microsoft's personal Web server installed on my machine and then transfer all the pages to my LINUX server. Using relative links allows me to keep to a minimum of changes when I move the files across to a server with a different URL.

Things learnt