<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[ PHP实现http与https转化]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 28 Jan 2010 05:24:27 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	最近在写PHP程序时，需要使浏览器在https和http之间转化，上网搜索相关信息，无奈只有最近在写PHP程序时，需要使浏览器在https和http之间转化，上网搜索相关信息，无奈只有一篇介绍用ASP实现“在http和https之间转化”的文章，于是只好行写了用PHP实现http与https转化的代码。<br/>　　如果网页使用https访问，在网页开头加入以下代码：<br/>view plainprint?<br/><br/>&nbsp;&nbsp; 1. &lt;?php&nbsp;&nbsp;<br/>&nbsp;&nbsp; 2. //http转化为https&nbsp;&nbsp; <br/>&nbsp;&nbsp; 3. if ($_SERVER[&quot;HTTPS&quot;]&lt;&gt;&quot;on&quot;)&nbsp;&nbsp;<br/>&nbsp;&nbsp; 4. {&nbsp;&nbsp;<br/>&nbsp;&nbsp; 5. $xredir=&quot;https://&quot;.$_SERVER[&quot;SERVER_NAME&quot;].&nbsp;&nbsp;<br/>&nbsp;&nbsp; 6. $_SERVER[&quot;REQUEST_URI&quot;];&nbsp;&nbsp;<br/>&nbsp;&nbsp; 7. header(&quot;Location: &quot;.$xredir);&nbsp;&nbsp;<br/>&nbsp;&nbsp; 8. }&nbsp;&nbsp; <br/>&nbsp;&nbsp; 9. ?&gt;&nbsp;&nbsp;<br/><br/>&lt;?php //http转化为https if ($_SERVER[&quot;HTTPS&quot;]&lt;&gt;&quot;on&quot;) { $xredir=&quot;https://&quot;.$_SERVER[&quot;SERVER_NAME&quot;]. $_SERVER[&quot;REQUEST_URI&quot;]; header(&quot;Location: &quot;.$xredir); } ?&gt;<br/>　　如果网页使用http访问，在网页开头加入以下代码：<br/>view plainprint?<br/><br/>&nbsp;&nbsp; 1. &lt;?php&nbsp;&nbsp;<br/>&nbsp;&nbsp; 2. //https转化为http&nbsp;&nbsp; <br/>&nbsp;&nbsp; 3. if ($_SERVER[&quot;HTTPS&quot;]==&quot;on&quot;)&nbsp;&nbsp;<br/>&nbsp;&nbsp; 4. {&nbsp;&nbsp;<br/>&nbsp;&nbsp; 5. $xredir=&quot;http://&quot;.$_SERVER[&quot;SERVER_NAME&quot;].&nbsp;&nbsp;<br/>&nbsp;&nbsp; 6. $_SERVER[&quot;REQUEST_URI&quot;];&nbsp;&nbsp;<br/>&nbsp;&nbsp; 7. header(&quot;Location: &quot;.$xredir);&nbsp;&nbsp;<br/>&nbsp;&nbsp; 8. }&nbsp;&nbsp; <br/>&nbsp;&nbsp; 9. ?&gt;&nbsp;&nbsp;
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论]  PHP实现http与https转化]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>