use script only on non secure pages.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vijay2591
    New Member
    • Jun 2013
    • 2

    use script only on non secure pages.

    I am working on Magento.
    I have to apply script only on non-secure pages this script is not affected on secure page.
    pls give me some idea how to do??
    Thanks in advance........ ....!!!!!!!!!!!
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    What do you mean by "non-secure"? Are you talking about pages not requested through SSL/TSL? If that is the case, you can check the $_SERVER["HTTPS"] element. It will be a non-empty value if the request was made securely.
    Code:
    if (!empty($_SERVER["HTTPS"])) {
        // It's a secure request.
    }
    else {
        // It's a non-secure request!
    }

    Comment

    Working...