Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Check for SSL

Posted on 2013-02-05
Last Modified: 2013-02-10
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.

if($_SERVER["HTTPS"] != "on" || $_SERVER["SERVER_PORT"] != "443") {
    <script type="text/javascript">

and I tried this - no alert!

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

It's out on 123ehost, so I can't set or control a lot of things.
Question by:dcass
  • 2
LVL 10

Assisted Solution

asavah earned 500 total points
ID: 38855960

Accepted Solution

dcass earned 0 total points
ID: 38855985
Don't think that will work here, but
$port = $_SERVER["SERVER_PORT"];    
if($port != "443") {
    <script type="text/javascript">
did work.  It wasn't setting https at all.

Author Closing Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Toggle & Anchor Links 5 43
Uploading a CSV Data Import via PHP & MySql 3 30
issue with DB import 1 17
Use Select Query to Return Results as a Form 9 23
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question