How to call a simple perl script from HTML without need of HTTPS but simple HTTP ?

W

Wladimir Borsov

I want to call a perl script myscript.pl in my cgi-bin from a HTML web page.
This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary).
Furthermore NO button click should be required (so I am not talking about a perl script in a form).

I only want to call this script automatically when someone load the web page.

How can I do this ?

If necessary the perl script could return a value (e.g. a picture resp. text string) to the calling page.

Wladimir
 
B

Bart Van der Donck

Wladimir said:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page.
This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary).
Furthermore NO button click should be required (so I am not talking about a perl script in a form).

I only want to call this script automatically when someone load the web page.

How can I do this ?

If necessary the perl script could return a value (e.g. a picture resp. text string) to the calling page.

You could use SSI (Server Side Includes) on unixoid systems:

<html>
<body>
<!--#exec cgi="/cgi-bin/script.pl"-->
</body>
</html>

Just don't forget to give your file the .shtml extension in stead of
..htm(l).

The output of /cgi-bin/script.pl will be displayed inside the webpage
that calls the script. (could be text, image, etc.)

Hope this helps,
 
B

Bart Van der Donck

Wladimir said:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page.
This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary).
Furthermore NO button click should be required (so I am not talking about a perl script in a form).

I only want to call this script automatically when someone load the web page.

How can I do this ?

If necessary the perl script could return a value (e.g. a picture resp. text string) to the calling page.

Sorry, I overlooked SSI was not an option for you. (However, why
doesn't it work over HTTPS ? If you place yourscript.pl e.g. in the
same SSL-enabled directory, that should normally work)

I think there is no other way to call CGI from within HTML, at least
not a direct one.

Maybe

<p>Original page</p>
<iframe width="0" height="0" src="/cgi-bin/myscript.pl"
style="visibility:hidden; display:none; width:0px; height:0px">
</iframe>

You could then adjust the iframe's height/width if you know what kind
of output you're expecting from myscript.pl. Client side scripting (eg
javascript) could be helpful too in this scenario.

Hope this helps,
 
B

Bart Van der Donck

Wladimir said:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page.
This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary).
[...]

Misconception. Maybe you're confusing SSI (Server Side Inlcudes) with
SSL (Secure Socket Layer) ? SSL works over HTTPS, but has nothing to do
with SSI.

So maybe you can use SSI after all :)
 
T

Tintin

Wladimir Borsov said:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page.
This call should NOT use SSI (because in this case HTTPS://.... protocol
is necessary).

https and SSI are not incompatible or mutually exclusive, so I have no idea
why you place this restriction on yourself.
Furthermore NO button click should be required (so I am not talking about a perl script in a form).

I only want to call this script automatically when someone load the web
page.

Then use Javascript.

Of course, none of this has anything to do with Perl.



*** ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top