Determine http or https in CGI perl

--bcaec52163238b750c04ae72dce2
Content-Type: text/plain; charset=ISO-8859-1

In my cgi program .. I want to know if the user is accessing via HTTP or
HTTPS.

How can I do this ?

--
Thanks
Ram
<http://www.netcore.co.in/>




n <http://pragatee.com>

--bcaec52163238b750c04ae72dce2--
Ramprasad Prasad [ Di, 04 Oktober 2011 08:04 ] [ ID #2065248 ]

Re: Determine http or https in CGI perl

Hi Ram,

On Tue, 4 Oct 2011 11:34:16 +0530
Ramprasad Prasad <ramprasad.ap [at] gmail.com> wrote:

> In my cgi program .. I want to know if the user is accessing via HTTP or
> HTTPS.
>
> How can I do this ?
>

A quick Google search yielded this link:

http://stackoverflow.com/questions/5223341/how-do-i-identify -the-protocol-h=
ttp-vs-https-using-perls-cgi-pm

Here's a shorter link:

http://stackoverflow.com/questions/5223341

Reading from there, one option would be:

my $is_secure =3D $cgi->request_uri =3D~ m{^https://};

And a better one is:

[QUOTE]
CGI.pm has an https() method that, according to the documentation:

operates on the HTTPS environment variables present when the SSL protoc=
ol is in effect. Can be used to determine whether SSL is turned on.

This is probably what you're looking for. Without parameters, it returns a =
list of HTTPS environment variables.
[/QUOTE]

Regards,

Shlomi Fish

--
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
What does "Zionism" mean? - http://shlom.in/def-zionism

=E2=80=9CI simply hate, detest, loathe, despise, and abhor redundancy.=E2=
=80=9D
=E2=80=94 http://uncyclopedia.org/wiki/Redundancy

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Shlomi Fish [ Di, 04 Oktober 2011 08:36 ] [ ID #2065249 ]
Perl » gmane.comp.lang.perl.beginners » Determine http or https in CGI perl

Vorheriges Thema: Validating input
Nächstes Thema: explicit package name