how to check http:// or https:// ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I need to check does URL use http or https?

Right now I use this code:

if(preg_match('/https:/', $_SERVER['SCRIPT_URI']) == false) {
  header('location: [URL]https://www.test.com/test.php[/URL]');
  exit;
}

but I am sure there is much better solution.
:)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux