Link to home
Start Free TrialLog in
Avatar of dcass
dcassFlag for United States of America

asked on

Check for SSL

This is not working - can't figure out why.
If I try to change the header, I get an error.
If I try to echo the server variables, I get an error.

<?php
if($_SERVER["HTTPS"] != "on" || $_SERVER["SERVER_PORT"] != "443") {
?>
    <script type="text/javascript">
      document.forms[0].action="https://www.xxxxxxxx.com/order.php";
      document.forms[0].submit();
    </script>
<?php
}
?>

and I tried this - no alert!

<script type="text/javascript">
var sValue = <?php $_SERVER["HTTPS"] ?>;
alert(sValue);
</script>  

It's out on 123ehost, so I can't set or control a lot of things.
SOLUTION
Avatar of Member_2_6373554
Member_2_6373554

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dcass

ASKER

I didn't try your solution asavah, but I appreciate your fast response!