You are here: Re: [PHP] how to check http:// or https:// ? « PHP « IT news, forums, messages
Re: [PHP] how to check http:// or https:// ?

Posted by Marco Tabini on 08/05/05 21:11

IIRC, if you're using Apache you can check

If (isset ($_SERVER['HTTPS']))

You can also check this thread:

http://beeblex.com/lists/index.php/php.general/190410?h=%24_SERVER%5B%27HTTP
S%27%5D

--
BeebleX - The PHP Search Engine
http://beeblex.com

On 8/5/05 2:05 PM, "afan@afan.net" <afan@afan.net> wrote:

> 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.
> :)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация