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

Discussion in 'Perl Misc' started by Wladimir Borsov, May 11, 2006.

  1. 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
    Wladimir Borsov, May 11, 2006
    #1
    1. Advertising

  2. Wladimir Borsov wrote:

    > 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,

    --
    Bart
    Bart Van der Donck, May 11, 2006
    #2
    1. Advertising

  3. Wladimir Borsov wrote:

    > 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,

    --
    Bart
    Bart Van der Donck, May 11, 2006
    #3
  4. Wladimir Borsov wrote:

    > 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 :)

    --
    Bart
    Bart Van der Donck, May 11, 2006
    #4
  5. Wladimir Borsov

    Tintin Guest

    "Wladimir Borsov" <> wrote in message
    news:4462f7de$0$11064$-online.net...
    > 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.



    *** Posted via a free Usenet account from http://www.teranews.com ***
    Tintin, May 11, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,517
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,792
  3. ad
    Replies:
    1
    Views:
    309
    Mark Rae [MVP]
    Mar 22, 2008
  4. zigzagdna
    Replies:
    1
    Views:
    533
    Arne Vajhøj
    Jul 29, 2010
  5. Tamer
    Replies:
    2
    Views:
    217
    António Marques
    Jan 21, 2008
Loading...

Share This Page