Jump to content

stwong

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stwong's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote author=448191 link=topic=101899.msg405351#msg405351 date=1154115221] Back from work. if(stristr($_SERVER["SERVER_PROTOCOL"],'HTTPS')) to determin if you're on the regular of secure server. [/quote] Then switch back to HTTP if procotol is HTTPS ?  Thanks a lot.
  2. Thanks to you all.  The apache running on my server supports both http and https.  The cases where https is required are when user clicks the login button or some functions that require authentication.  The action follows: http://myserver/user.php?action=login Then I add lines to beginning of user.php: $url = $_SERVER['SERVER_NAME']; $query = $_SERVER['QUERY_STRING']; $path = $_SERVER['PHP_SELF']; header("Location: https://$url$path?$query"); This redirects my browser to use https as expected.  However, after successful user authentication, I don't know how to "switch back" to http since I've no idea about which URL that "calls" user.php. I've to add header("Location: http://....") to every PHP script that will be invoked after authentication.  I'm afraid this is not the right way to do that.  Would anyone pls help? Thank you ver much.
  3. Hi, all, I'm newbie to PHP.  I'm trying to modify a program so that all page except login are http.  I try the header function as following: --------------- cut here ------------- if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on")) {   $url = $_SERVER['SERVER_NAME'];   $query = $_SERVER['QUERY_STRING'];   $path = $_SERVER['PHP_SELF'];   header("Location: http://$url$path?$query"); } --------------- cut here ------------- However, this always reload the "current" login page which is called from some other pages (html or PHP), e.g. <a href="authenticate.php?action=login"> Would anyone please help?  Sorry for the newbie question and poor English. Thanks a lot.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.