SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Notice: Undefined index: HTTPS

  1. #1
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Notice: Undefined index: HTTPS

    Hi,

    I have a small little problem that kinda bugs me for a while now and thought I would try to fix it once and for all.

    Code:
    <?php
    function curPageURL() {
    $pageURL = 'http';
    if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];} 
    else {$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; }
    return $pageURL;}
    ?>
    Any ideas how can I fix this error here?

  2. #2
    From Italy with love bronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    8,654
    Mentioned
    77 Post(s)
    Tagged
    4 Thread(s)
    PHP Code:
    if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) 

  3. #3
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot,

    That fixed it!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •