Using the active protocol

Hello,

I’ve been wondering how its possible to make a link to other domain with the current active protocol?

For instance:

Users comes to mywebsite.com and he posts a form:

  1. he is on http://mywebsite.com so form should post
    http://someotherdomain.com

  2. he is on https://mywebsite.com (SSL) so form should post to
    https://someotherdomain.com

Is there any way to set form post action to “://someotherdomain.com” so that browser would automatically use the current used protocol (http or https) accordingly?

Thanks for help

Kundi,

I believe that this is a PHP question …

… where I would have the form’s script fetch Apache’s {HTTPS} variable OR {SERVER_PORT} variable (using $_SERVER[‘HTTPS’] or $_SERVER[‘SERVER_PORT’]) and test for on/null or 80/443 and add the “s” to http in the action accordingly.

Regards,

DK