in reply to Check https connection open

How can I check that https is open automatically in order to place right action URL in the login form (HTTPS://myservice.... instead of a regular one HTTP://.....)?

What does "check that https is open automatically" mean?

If you use relative urls/action, visiting https, remains on https

Replies are listed 'Best First'.
Re^2: Check https connection open
by vit (Friar) on Jun 16, 2011 at 14:57 UTC
    I want to use HTTPS in my site url when it is available and HTTP when it is not.
    On our production server we opened a special port in Amazon EC2 for HTTPS secure communication, whereas on my local server I don't have it.
    So I want to form a right action automatically without manually changing to http on my local server and back to https on production server in my code.
    In other words I want to put a right $action in
    <form name="query_form" action=$action method="POST"