Re: https help
| From: | Negin Nickparsa | Date: | Tue, 31 May 2011 05:34:43 +0000 |
| Subject: | Re: https help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313255@lists.php.net to get a copy of this message | ||
I need to create a login page with HTTPS to yahoo
Do I have to have a valid certificate?
I have not trust certification centre, so before anything under HTTPS will
be shown up, the window will come with information: valid certificate: yes,
valid domain: yes, valid authority for SSL key: no.
am I right?
<?php
//if not on HTTPS
if(empty($_SERVER['HTTPS'])) {
//build link to https page; protocol, server and current script path
$url = "Location: https://www.yahoo.com/";
//addy querystring, if appropriate
if(count($_GET) != 0) {
$url .= "?";
foreach($_GET as $key => $value) {
$url .= "$key=$value&";
}
}
//send permanent move redirect
header($url, true, 301);
}
?>
but it goes to http://www.yahoo.com