Re: https help
| From: | Tamara Temple | Date: | Wed, 01 Jun 2011 06:04:31 +0000 |
| Subject: | Re: https help | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313286@lists.php.net to get a copy of this message | ||
On May 31, 2011, at 12:34 AM, Negin Nickparsa wrote:
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.comI don't have an answer to your question, but you should look at http_build_query: http://us.php.net/manual/en/function.http-build-query.php for the last part of your code. It makes the query string safe for transmittal.