<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>创意纪 &#187; php</title>
	<atom:link href="http://chuangyiji.com/category/program/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://chuangyiji.com</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 15:20:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>基于php获取msn的好友列表</title>
		<link>http://chuangyiji.com/2009/07/08/php-based-access-to-msn-friends-list/</link>
		<comments>http://chuangyiji.com/2009/07/08/php-based-access-to-msn-friends-list/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 01:46:20 +0000</pubDate>
		<dc:creator>wingfish</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[msn]]></category>

		<guid isPermaLink="false">http://chuangyiji.com/2009/07/08/php-based-access-to-msn-friends-list/</guid>
		<description><![CDATA[从这里看到，再加一个发送邮件，可以做msn好友邀请了，我相信这样的病毒是营销多少还是有些作用的。 &#160; &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; xml:lang=&#34;zh&#34; lang=&#34;zh&#34;&#62; &#60;head&#62; &#60;title&#62;MSN 测试&#60;/title&#62; &#60;meta name=&#34;generator&#34; content=&#34;Bluefish 1.0.6&#34;/&#62; &#60;meta name=&#34;keywords&#34; content=&#34;MSN&#34;/&#62; &#60;meta name=&#34;description&#34; content=&#34;MSN test&#34;/&#62; &#60;meta http-equiv=&#34;content-type&#34; content=&#34;text/html; charset=UTF-8&#34;/&#62; &#60;style type=&#34;text/css&#34;&#62; &#60;!-- div { 　　　 font-family: arial, &#8230; <a href="http://chuangyiji.com/2009/07/08/php-based-access-to-msn-friends-list/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>从<a href="http://www.wesoho.com/default.asp?id=2738">这里</a>看到，再加一个发送邮件，可以做msn好友邀请了，我相信这样的病毒是营销多少还是有些作用的。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;zh&quot; lang=&quot;zh&quot;&gt;
&lt;head&gt;
&lt;title&gt;MSN 测试&lt;/title&gt;
&lt;meta name=&quot;generator&quot; content=&quot;Bluefish 1.0.6&quot;/&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;MSN&quot;/&gt;
&lt;meta name=&quot;description&quot; content=&quot;MSN test&quot;/&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot;/&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
div {
　　　 font-family: arial, helvetica, sans-serif;
　　　 font-size : 13px ;
　　　 margin: 10px;
　　　 padding: 2px 10px 1px;
　　　 background-color: #C60;
　　　 color: #FFFFFF;
　　　 border-top: 1px solid #C90;
　　　 border-left: 1px solid #C90;
　　　 border-bottom: 1px solid #333;
　　　 border-right: 1px solid #333;
}prom dresses  
a:link {
　　　 color: #00FFBE;
}
--&gt;&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;"># filename: fm.php
</span><span style="color: #666666; font-style: italic;"># purpose: get MSN contact list
</span><span style="color: #666666; font-style: italic;"># author: http://qartis.com/?qmsn modified by Druggo
</span><span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$debug</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$trid</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$proto</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;MSNP10&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># start here
</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;通讯协议 <span style="color: #006699; font-weight: bold;">$proto</span>&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;开始登录&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># login nowloctite  
</span><span style="color: #000088;">$sbconn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;messenger.hotmail.com&quot;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1863</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Can't connect to MSN server&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;VER <span style="color: #006699; font-weight: bold;">$trid</span> <span style="color: #006699; font-weight: bold;">$proto</span> CVR0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CVR <span style="color: #006699; font-weight: bold;">$trid</span> 0x0409 winnt 5.1 i386 MSNMSGR 8.0.0812 MSMSGS <span style="color: #006699; font-weight: bold;">$username</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;USR <span style="color: #006699; font-weight: bold;">$trid</span> TWN I <span style="color: #006699; font-weight: bold;">$username</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">stristr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">601</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #666666; font-style: italic;">#echo &quot;Error: The MSN servers are currently unavailable.&quot;;
</span>　　　　　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;很不幸，MSN的服务器又挂了 &gt;.&lt;&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;连接失败!&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sbconn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>guangzhou massage
<span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sbconn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sbconn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;error -_-#&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;VER <span style="color: #006699; font-weight: bold;">$trid</span> <span style="color: #006699; font-weight: bold;">$proto</span> CVR0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CVR <span style="color: #006699; font-weight: bold;">$trid</span> 0x0409 winnt 5.1 i386 MSNMSGR 8.0.0812 MSMSGS <span style="color: #006699; font-weight: bold;">$username</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;USR <span style="color: #006699; font-weight: bold;">$trid</span> TWN I <span style="color: #006699; font-weight: bold;">$username</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$TOKENSTRING</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">end</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#echo &quot;authenticating&quot;;
</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;身份验证中……&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$nexus_socket</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ssl://nexus.passport.com&quot;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">443</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nexus_socket</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;GET /rdr/pprdr.asp HTTP/1.0rnrn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nexus_socket</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;PassportURLs&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #000088;">$urls</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">14</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>shanghai escort
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$urls</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nexus_socket</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$ssl_conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ssl://&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">443</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;GET /<span style="color: #006699; font-weight: bold;">{$temp_array[1]}</span> HTTP/1.1rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Authorization: Passport1.4 orgVerb=GET,OrgURL=http%3A<span style="color: #009933; font-weight: bold;">%2F</span><span style="color: #009933; font-weight: bold;">%2F</span>messenger%2Emsn%2Ecom,sign-in=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;,pwd=<span style="color: #006699; font-weight: bold;">$password</span>,<span style="color: #006699; font-weight: bold;">$TOKENSTRINGrn</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;User-Agent: MSMSGSrn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Host: <span style="color: #006699; font-weight: bold;">{$temp_array[0]}</span>rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Connection: Keep-Alivern&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Cache-Control: no-cachernrn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">512</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;HTTP/1.1 302 Found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #666666; font-style: italic;">#echo &quot;redirection&quot;;
</span>　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;开始重定向&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">256</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;Location:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　　　　　 <span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　　　　　 <span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">,</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">end</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　　　　　 <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #009900;">&#125;</span>
　　　 <span style="color: #009900;">&#125;</span>
　　　 <span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #000088;">$ssl_conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ssl://&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">443</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;GET /<span style="color: #006699; font-weight: bold;">{$temp_array[3]}</span> HTTP/1.1rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Authorization: Passport1.4 orgVerb=GET,OrgURL=http%3A<span style="color: #009933; font-weight: bold;">%2F</span><span style="color: #009933; font-weight: bold;">%2F</span>messenger%2Emsn%2Ecom,sign-in=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;,pwd=<span style="color: #006699; font-weight: bold;">$password</span>,<span style="color: #006699; font-weight: bold;">$TOKENSTRINGrn</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;User-Agent: MSMSGSrn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Host: <span style="color: #006699; font-weight: bold;">{$temp_array[2]}</span>rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Connection: Keep-Alivern&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Cache-Control: no-cachernrn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;HTTP/1.1 401 Unauthorized&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #666666; font-style: italic;">#echo &quot;invalidcreds&quot;;
</span>　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;验证失败！&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;HTTP/1.1 200 OK&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #666666; font-style: italic;">#echo &quot;Unknown HTTP status code: $temp&lt;br&gt;&quot;;
</span>　　　　　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;未知状态码 <span style="color: #006699; font-weight: bold;">$temp</span>&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #666666; font-style: italic;">#echo &quot;set_bar_len30?&quot;;
</span>　　　 <span style="color: #009900;">&#125;</span>massage shanghai  
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">19</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;Authentication-Info&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #000088;">$auth_info</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">14</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">&quot;Content-Length&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　　　　　 <span style="color: #000088;">$auth_info</span><span style="color: #339933;">.=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #009900;">&#125;</span>
　　　　　　　 <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ssl_conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$auth_info</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;USR <span style="color: #006699; font-weight: bold;">$trid</span> TWN S <span style="color: #006699; font-weight: bold;">{$temp_array[1]}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$temp</span><span style="color: #339933;">=</span>data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$time_since_initmsg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">strstr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;ABCHMigrated&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_string</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;sid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #000088;">$sid</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;kv&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #000088;">$kv</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;MSPAuth&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　　　　　 <span style="color: #000088;">$mspauth</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　　　　　 <span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#echo &quot;authenticated&lt;br /&gt;&quot;;
</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;验证通过！&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>shanghai massage 
<span style="color: #666666; font-style: italic;">#data_out(&quot;LST 9 RL&quot;);
</span><span style="color: #666666; font-style: italic;">#data_in();
</span>data_out<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SYN <span style="color: #006699; font-weight: bold;">$trid</span> 0 0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#echo &quot;retreiving_contact_list&lt;br /&gt;&quot;;
</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;正在获取好友列表……&lt;br/&gt;&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">stream_set_timeout</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sbconn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">125000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* a lazy man doing this :D */</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">160</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;"># some say max is 150
</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
　　　 <span style="color: #009900;">&#123;</span>
　　　 <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;LST&quot;</span><span style="color: #339933;">:</span>
　　　 <span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #000088;">$un</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #000088;">$nn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #000088;">$nn1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nn1</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #009900;">&#41;</span>
　　　 <span style="color: #009900;">&#123;</span>
　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=&quot;</span>mailto<span style="color: #339933;">:</span><span style="color: #000088;">$un</span><span style="color: #0000ff;">&quot;&gt;<span style="color: #006699; font-weight: bold;">$nn</span>&lt;/a&gt;&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
　　　 <span style="color: #b1b100;">else</span>
　　　 <span style="color: #009900;">&#123;</span>
　　　 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;曾经的好友: <span style="color: #006699; font-weight: bold;">$un</span>&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>barbed wire  
　　　 <span style="color: #666666; font-style: italic;">#echo $temp.&quot;&lt;br/&gt;&quot;;
</span>　　　 <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
　　　 <span style="color: #666666; font-style: italic;"># no nothing
</span>　　　 <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
　　　 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;列表结束&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sbconn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># end here
</span><span style="color: #666666; font-style: italic;"># functions
</span><span style="color: #000000; font-weight: bold;">function</span> data_out<span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$sbconn</span><span style="color: #339933;">,</span><span style="color: #000088;">$debug</span><span style="color: #339933;">,</span><span style="color: #000088;">$trid</span><span style="color: #339933;">;</span>
　　　 <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sbconn</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;rn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #000088;">$trid</span><span style="color: #339933;">++;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$debug</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&gt; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;rn&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> data_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
　　　 <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$sbconn</span><span style="color: #339933;">,</span><span style="color: #000088;">$debug</span><span style="color: #339933;">;</span>
　　　 <span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sbconn</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">256</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　　 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$debug</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$temp</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;rn&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
　　　 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>chain <span style="color: #990000;">link</span> fencing  
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>


	<h4>相关内容</h4>
	<ul class="st-related-posts">
	<li><a href="http://chuangyiji.com/2008/08/02/php-through-msn-news-sent-directly-to/" title="通过php来直接发送msn消息 (August 2, 2008)">通过php来直接发送msn消息</a> (3)</li>
	<li><a href="http://chuangyiji.com/2009/08/17/msn-submarine-accident-caused-by-large-scale-fault/" title="海缆事故造成MSN大规模故障 (August 17, 2009)">海缆事故造成MSN大规模故障</a> (6)</li>
	<li><a href="http://chuangyiji.com/2009/03/17/kfc-web-design-lei-me/" title="我被KFC的msn网页广告设计雷到了 (March 17, 2009)">我被KFC的msn网页广告设计雷到了</a> (0)</li>
	<li><a href="http://chuangyiji.com/2009/02/19/strange-msn-connection-problem/" title="奇怪的msn连接问题 (February 19, 2009)">奇怪的msn连接问题</a> (0)</li>
	<li><a href="http://chuangyiji.com/2009/06/17/age-of-the-internet-rapid-access-to-information-kinds-of-methods/" title="互联网时代，快速获得信息的5种方法 (June 17, 2009)">互联网时代，快速获得信息的5种方法</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://chuangyiji.com/2009/07/08/php-based-access-to-msn-friends-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.3版本发布</title>
		<link>http://chuangyiji.com/2009/07/04/php-5-3-release/</link>
		<comments>http://chuangyiji.com/2009/07/04/php-5-3-release/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 14:30:14 +0000</pubDate>
		<dc:creator>wingfish</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[升级]]></category>

		<guid isPermaLink="false">http://chuangyiji.com/2009/07/04/php-5-3-release/</guid>
		<description><![CDATA[PHP开发团队在2009年6月30日宣布正式发布PHP 5.3。新版本是5.X系列的一次重大更新，包含了大量新特性和bug修正。 一些主要的新特性包括：命名空间（namespaces），迟静态绑定(Late static binding)，闭包（closures），可选的循环引用垃圾收集，新的扩展（如ext/phar，ext/intl和ext/fileinfo），和超过140个bug修正等等。PHP为PHP 5.2用户升级发布了迁移指南，更多变化可见ChangeLog。 摘自这里 相关内容 通过php来直接发送msn消息 (3) 转载:每一个PHP开发者应该知道的五必不可少的发展要素 (0) 谁家语言将成为Google App Engine的下一个宠儿？ (4) 请速升级你的Pidgin至2.2.1版 (4) 记录一下自己进行开发的工具 (0)]]></description>
			<content:encoded><![CDATA[<p>PHP开发团队在2009年6月30日宣布正式发布<a href="http://www.php.net/archive/2009.php#id2009-06-30-1">PHP 5.3</a>。新版本是5.X系列的一次重大更新，包含了大量新特性和bug修正。</p>
<p>一些主要的新特性包括：命名空间（namespaces），迟静态绑定(Late static binding)，闭包（closures），可选的循环引用垃圾收集，新的扩展（如ext/phar，ext/intl和ext/fileinfo），和超过140个bug修正等等。PHP为PHP 5.2用户升级发布了<a href="http://php.net/migration53">迁移指南</a>，更多变化可见<a href="http://php.net/ChangeLog-5.php">ChangeLog</a>。</p>
<p>摘自<a href="http://developers.solidot.org/article.pl?sid=09/07/01/0241217&amp;amp;from=rss" target="_blank">这里</a></p>

	<h4>相关内容</h4>
	<ul class="st-related-posts">
	<li><a href="http://chuangyiji.com/2008/08/02/php-through-msn-news-sent-directly-to/" title="通过php来直接发送msn消息 (August 2, 2008)">通过php来直接发送msn消息</a> (3)</li>
	<li><a href="http://chuangyiji.com/2008/07/06/reproduced-every-php-developers-should-be-aware-that-the-development-of-the-five-essential-elements/" title="转载:每一个PHP开发者应该知道的五必不可少的发展要素 (July 6, 2008)">转载:每一个PHP开发者应该知道的五必不可少的发展要素</a> (0)</li>
	<li><a href="http://chuangyiji.com/2008/10/24/who-will-be-the-language-of-google-app-engine-for-the-next-pet/" title="谁家语言将成为Google App Engine的下一个宠儿？ (October 24, 2008)">谁家语言将成为Google App Engine的下一个宠儿？</a> (4)</li>
	<li><a href="http://chuangyiji.com/2007/09/30/pidgin-update-to-221/" title="请速升级你的Pidgin至2.2.1版 (September 30, 2007)">请速升级你的Pidgin至2.2.1版</a> (4)</li>
	<li><a href="http://chuangyiji.com/2008/08/17/record-your-own-tools-for-development/" title="记录一下自己进行开发的工具 (August 17, 2008)">记录一下自己进行开发的工具</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://chuangyiji.com/2009/07/04/php-5-3-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用 JavaScript 实现 PHP 函数功能：PHP.JS</title>
		<link>http://chuangyiji.com/2009/05/30/php-function-to-achieve-the-use-of-javascript-function-phpjs/</link>
		<comments>http://chuangyiji.com/2009/05/30/php-function-to-achieve-the-use-of-javascript-function-phpjs/#comments</comments>
		<pubDate>Sat, 30 May 2009 01:45:32 +0000</pubDate>
		<dc:creator>wingfish</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://chuangyiji.com/?p=1861</guid>
		<description><![CDATA[PHP.JS 是一个开源的 JavaScript 库，它尝试在 JavaScript 中实现 PHP 函数。在你的项目中导入 PHP.JS 库，可以在静态页面使用你喜欢的 PHP 函数。 对于熟悉 PHP 的程序员来说，当他想在静态页面中使用 PHP 函数的时候，PHP.JS 是非常方便的，现在已经 400 多个 PHP 函数在 PHP.JS 中实现，还有一些正在被实现，不过现在已经能够找到大部分流行的了，甚至md5()，并且 PHP.JS 实现了一个高级的函数，如： file_get_contents(), mktime(), serialize() 等。 使用 PHP.JS 非常简单，不需要任何服务器支持，现在可以三种方式使用它： 下载默认的 PHP.JS 包。 或者配置 PHP.JS 选择自己需要的函数，然后下载。 甚至直接选择需要的某一函数，直接 &#8230; <a href="http://chuangyiji.com/2009/05/30/php-function-to-achieve-the-use-of-javascript-function-phpjs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="border-collapse: separate; color: #000000; font-family: arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px;"><a style="color: #2244bb;" href="http://phpjs.org/" target="_blank">PHP.JS</a><span class="Apple-converted-space"> </span>是一个开源的 <a href="http://chuangyiji.com/2007/08/20/javascript-%e6%98%af%e6%80%8e%e6%a0%b7%e8%ae%a9%e4%ba%92%e8%81%94%e7%bd%91%e5%8f%98%e6%85%a2%e7%9a%84%ef%bc%88%e5%8f%8a%e5%af%b9%e7%ad%96%ef%bc%89-%e8%af%91%e8%a8%80%e7%bf%bb%e8%af%91/">JavaScript </a>库，它尝试在 JavaScript 中实现 PHP 函数。在你的项目中导入 PHP.JS 库，可以在静态页面使用你喜欢的 PHP 函数。</p>
<p>对于熟悉 PHP 的程序员来说，当他想在静态页面中使用 PHP 函数的时候，PHP.JS 是非常方便的，现在已经 400 多个 PHP 函数在 PHP.JS 中实现，还有一些正在被实现，不过现在已经能够找到大部分流行的了，甚至<code style="font-size: 11px;">md5()</code>，并且 PHP.JS 实现了一个高级的函数，如：<span class="Apple-converted-space"> </span><code style="font-size: 11px;">file_get_contents()</code>,<span class="Apple-converted-space"> </span><code style="font-size: 11px;">mktime()</code>,<span class="Apple-converted-space"> </span><code style="font-size: 11px;">serialize()</code><span class="Apple-converted-space"> </span>等。</p>
<p>使用 PHP.JS 非常简单，不需要任何服务器支持，现在可以三种方式使用它：</p>
<ol>
<li>下载<a style="color: #2244bb;" href="http://phpjs.org/packages/view/php.default.min.js" target="_blank">默认的 PHP.JS 包</a>。</li>
<li>或者<a style="color: #2244bb;" href="http://phpjs.org/packages/configure" target="_blank">配置 PHP.JS</a><span class="Apple-converted-space"> </span>选择自己需要的函数，然后下载。</li>
<li>甚至直接选择需要的某一<a style="color: #2244bb;" href="http://phpjs.org/functions/index" target="_blank">函数</a>，直接 Copy 过去使用。</li>
</ol>
<p>摘自<a href="http://fairyfish.net/2009/05/28/php-js/">这里</a></span></span></p>

	<h4>相关内容</h4>
	<ul class="st-related-posts">
	<li><a href="http://chuangyiji.com/2008/08/02/php-through-msn-news-sent-directly-to/" title="通过php来直接发送msn消息 (August 2, 2008)">通过php来直接发送msn消息</a> (3)</li>
	<li><a href="http://chuangyiji.com/2008/12/14/reproduced-the-new-hand-written-on-the-basis-of-jquery-video-tutorial/" title="转载：为新手写的jQuery基础视频教程 (December 14, 2008)">转载：为新手写的jQuery基础视频教程</a> (0)</li>
	<li><a href="http://chuangyiji.com/2008/07/06/reproduced-every-php-developers-should-be-aware-that-the-development-of-the-five-essential-elements/" title="转载:每一个PHP开发者应该知道的五必不可少的发展要素 (July 6, 2008)">转载:每一个PHP开发者应该知道的五必不可少的发展要素</a> (0)</li>
	<li><a href="http://chuangyiji.com/2008/10/24/who-will-be-the-language-of-google-app-engine-for-the-next-pet/" title="谁家语言将成为Google App Engine的下一个宠儿？ (October 24, 2008)">谁家语言将成为Google App Engine的下一个宠儿？</a> (4)</li>
	<li><a href="http://chuangyiji.com/2008/08/17/record-your-own-tools-for-development/" title="记录一下自己进行开发的工具 (August 17, 2008)">记录一下自己进行开发的工具</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://chuangyiji.com/2009/05/30/php-function-to-achieve-the-use-of-javascript-function-phpjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache-php一站式解决方案：xampp</title>
		<link>http://chuangyiji.com/2009/05/23/apache-php-one-stop-solution-xampp/</link>
		<comments>http://chuangyiji.com/2009/05/23/apache-php-one-stop-solution-xampp/#comments</comments>
		<pubDate>Sat, 23 May 2009 13:47:53 +0000</pubDate>
		<dc:creator>wingfish</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://chuangyiji.com/?p=1843</guid>
		<description><![CDATA[谁都不喜欢繁琐的操作，如果可以有更加简单的办法。我在我的老iBook上开发php应用，但是我也不喜欢复杂的linux设置。windows上有不少AMP一体式解决方案，我在搜索mac下的解决方案的时候，发现了这个称之为apache friends的xampp，并且它是一体化的支持apache、php、mysql等。 适用于 Mac OS X 的 XAMPP 是 Mac OS X 上最简单，最实用，也最完整的网络服务器解决方案。该发行版包括整合了最新的 MySQL、PHP（4+5），和 Perl 的 Apache 2 服务器。它以 Mac OS X 安装包的方式发布，包含所有必须的文件，无需下载其它东西。 我下载后试用了一下，的确不错，主要的界面管理还是用web的，mac下面只是一个小小的启动服务器的面板。使用xampp后不会影响mac osx原来内置的apache等应用。 相关内容 如何在Max OSX 10.5 下设置php功能 (2) Mac Os leopard 下配置 PHP+Mysql和GD库 (0) 一个web版本应用开发研究 (8) Mac &#8230; <a href="http://chuangyiji.com/2009/05/23/apache-php-one-stop-solution-xampp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>谁都不喜欢繁琐的操作，如果可以有更加简单的办法。我在我的老<a href="http://chuangyiji.com/2008/07/29/i-and-my-pursuit-of-the-apple/">iBook</a>上开发<a href="http://chuangyiji.com/2009/05/23/mac-os-leopard-configure-php-mysql-and-gd-library/">php</a>应用，但是我也不喜欢复杂的linux设置。windows上有不少AMP一体式解决方案，我在搜索mac下的解决方案的时候，发现了这个称之为apache friends的<a href="http://www.apachefriends.org/zh_cn/index.html">xampp</a>，并且它是一体化的支持apache、php、mysql等。</p>
<blockquote><p>适用于 Mac OS X 的 XAMPP 是 Mac OS X 上最简单，最实用，也最完整的网络服务器解决方案。该发行版包括整合了最新的 MySQL、PHP（4+5），和 Perl 的 Apache 2 服务器。它以 Mac OS X 安装包的方式发布，包含所有必须的文件，无需下载其它东西。</p></blockquote>
<p>我下载后试用了一下，的确不错，主要的界面管理还是用web的，mac下面只是一个小小的启动服务器的面板。使用xampp后不会影响mac osx原来内置的<a href="http://chuangyiji.com/2009/05/23/max-osx-105-how-to-set-up-php-function-under/">apache</a>等应用。</p>

	<h4>相关内容</h4>
	<ul class="st-related-posts">
	<li><a href="http://chuangyiji.com/2009/05/23/max-osx-105-how-to-set-up-php-function-under/" title="如何在Max OSX 10.5 下设置php功能 (May 23, 2009)">如何在Max OSX 10.5 下设置php功能</a> (2)</li>
	<li><a href="http://chuangyiji.com/2009/05/23/mac-os-leopard-configure-php-mysql-and-gd-library/" title="Mac Os leopard 下配置 PHP+Mysql和GD库 (May 23, 2009)">Mac Os leopard 下配置 PHP+Mysql和GD库</a> (0)</li>
	<li><a href="http://chuangyiji.com/2009/05/19/version-of-a-web-application-development-and-research/" title="一个web版本应用开发研究 (May 19, 2009)">一个web版本应用开发研究</a> (8)</li>
	<li><a href="http://chuangyiji.com/2009/09/12/mac-keyboard-shortcuts-to-start-xiang-guan-list/" title="Mac 启动相关快捷键一览 (September 12, 2009)">Mac 启动相关快捷键一览</a> (0)</li>
	<li><a href="http://chuangyiji.com/2008/08/02/php-through-msn-news-sent-directly-to/" title="通过php来直接发送msn消息 (August 2, 2008)">通过php来直接发送msn消息</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://chuangyiji.com/2009/05/23/apache-php-one-stop-solution-xampp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Os leopard 下配置 PHP+Mysql和GD库</title>
		<link>http://chuangyiji.com/2009/05/23/mac-os-leopard-configure-php-mysql-and-gd-library/</link>
		<comments>http://chuangyiji.com/2009/05/23/mac-os-leopard-configure-php-mysql-and-gd-library/#comments</comments>
		<pubDate>Fri, 22 May 2009 23:35:39 +0000</pubDate>
		<dc:creator>wingfish</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://chuangyiji.com/?p=1840</guid>
		<description><![CDATA[继续找资料的时候，看到国内朋友的中文介绍，可以参考一下，来自这里 Mac下配置php环境： 1. 修改 /etc/apache2/httpd.conf 中 #LoadModule php5_module libexec/apache2/libphp5.so 把前面的#去掉。 2.将/etc/php.ini.default 复制到 /etc/php.ini sudo cp /etc/php.ini.default /etc/php.ini 3. 打开apache: 在 系统偏好设置-》共享 里面在web共享前打钩。右侧会提示 “Web 共享”允许其他电脑的用户查看这台电脑上的“站点”文件夹中的网页。 证明已经成功打开 4. 测试php 在 /用户/用户名/站点 里创建 index.php 内容为，成功输出php信息。但是发现并没有GD库的支持，文章后面会介绍如何配置 GD库。 Mac下配置Mysql: 1. 到 http://dev.mysql.com/downloads/ 下载最新版的 Mysql,这里下到的是 mysql-5.1.32-osx10.5-x86_64.dmg &#8230; <a href="http://chuangyiji.com/2009/05/23/mac-os-leopard-configure-php-mysql-and-gd-library/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>继续找资料的时候，看到国内朋友的中文介绍，可以参考一下，来自<a href="http://blog.meiu.cn/post/57/">这里</a></p>
<p>Mac下配置php环境：</p>
<p>1. 修改 /etc/apache2/httpd.conf 中<br />
#LoadModule php5_module        libexec/apache2/libphp5.so</p>
<p>把前面的#去掉。</p>
<p>2.将/etc/php.ini.default 复制到 /etc/php.ini<br />
sudo cp /etc/php.ini.default /etc/php.ini</p>
<p>3. 打开apache: 在 系统偏好设置-》共享 里面在web共享前打钩。右侧会提示<br />
“Web 共享”允许其他电脑的用户查看这台电脑上的“站点”文件夹中的网页。<br />
证明已经成功打开</p>
<p>4. 测试php<br />
在 /用户/用户名/站点 里创建 index.php 内容为，成功输出php信息。但是发现并没有GD库的支持，文章后面会介绍如何配置 GD库。</p>
<p>Mac下配置Mysql:</p>
<p>1. 到 http://dev.mysql.com/downloads/ 下载最新版的 Mysql,这里下到的是 mysql-5.1.32-osx10.5-x86_64.dmg</p>
<p>2. 双击 mysql-5.1.32-osx10.5-x86_64.dmg,先安装 mysql-5.1.32-osx10.5-x86_64.pkg ，然后安装MYSQLStartupItem.pkg.</p>
<p>3. 编辑 /etc/php.ini，将 mysql.default_socket = 后面 加上 /tmp/mysql.sock<br />
mysql.default_socket = /tmp/mysql.sock</p>
<p>给PHP配置GD:</p>
<p>1. 首先创建源代码目录：mkdir -p /SourceCache</p>
<p>2. 分别从<br />
http://www.ijg.org/files/jpegsrc.v6b.tar.gz ，<br />
http://www.libpng.org/pub/png/libpng.html ，</p>
<p>http://sourceforge.net/project/showfiles.php?group_id=3157&#038;package_id=3121</p>
<p>下载jpegsrc.v6b.tar.gz，libpng-1.2.35.tar.bz2，freetype-2.3.9.tar.gz，然后放入 SourceCache目录，解压这些压缩包</p>
<p>3. 安装libjpeg:<br />
打开终端，输入<br />
cd /SourceCache/jpeg-6b<br />
cp /usr/share/libtool/config.sub .<br />
cp /usr/share/libtool/config.guess .</p>
<p>./configure<br />
make<br />
sudo make install</p>
<p>4. 安装libpng:<br />
cd /SourceCache/libpng-1.2.35<br />
./configure<br />
make<br />
sudo make install</p>
<p>5.安装freetype<br />
cd /SourceCache/freetype-2.3.9<br />
./configure<br />
make<br />
sudo make install</p>
<p>6. 安装GD库:<br />
从http://www.opensource.apple.com/darwinsource/10.5.6/apache_mod_php-44.1/php-5.2.6.tar.bz2 下载php源码包<br />
tar xjf php-5.2.6.tar.bz2<br />
cd /SourceCache/php-5.2.6/ext/gd</p>
<p>phpize</p>
<p>MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=&#8221;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp&#8221; CCFLAGS=&#8221;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&#8221; CXXFLAGS=&#8221;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&#8221; LDFLAGS=&#8221;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&#8221; ./configure &#8211;with-zlib-dir=/usr &#8211;with-jpeg-dir=/usr/local/lib &#8211;with-png-dir=/usr/X11R6 &#8211;with-freetype-dir=/usr/X11R6 &#8211;with-xpm-dir=/usr/X11R6</p>
<p>make<br />
sudo make install</p>
<p>配置php加载gd.so：<br />
编辑/etc/php.ini ,增加一行</p>
<p>extension=gd.so</p>
<p>7 重启apache服务器</p>
<p>8 GD库安装成功！</p>
<p>注意： 如果 不能使用.configure 或make，请先安装  Xcode 3.1</p>

	<h4>相关内容</h4>
	<ul class="st-related-posts">
	<li><a href="http://chuangyiji.com/2009/05/23/max-osx-105-how-to-set-up-php-function-under/" title="如何在Max OSX 10.5 下设置php功能 (May 23, 2009)">如何在Max OSX 10.5 下设置php功能</a> (2)</li>
	<li><a href="http://chuangyiji.com/2009/05/23/apache-php-one-stop-solution-xampp/" title="apache-php一站式解决方案：xampp (May 23, 2009)">apache-php一站式解决方案：xampp</a> (0)</li>
	<li><a href="http://chuangyiji.com/2008/01/12/should-internet-like-now/" title="新的构思:互联网应该是这个样子的吗? (January 12, 2008)">新的构思:互联网应该是这个样子的吗?</a> (0)</li>
	<li><a href="http://chuangyiji.com/2009/07/24/the-use-of-sun-spelling-trouble-for-mac/" title="使用sun拼音for mac的麻烦 (July 24, 2009)">使用sun拼音for mac的麻烦</a> (0)</li>
	<li><a href="http://chuangyiji.com/2008/08/02/php-through-msn-news-sent-directly-to/" title="通过php来直接发送msn消息 (August 2, 2008)">通过php来直接发送msn消息</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://chuangyiji.com/2009/05/23/mac-os-leopard-configure-php-mysql-and-gd-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
