﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-每日E读-随笔分类-PHP</title><link>http://www.blogjava.net/hexuzhong/category/1132.html</link><description>HexUzHoNG</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 10:22:33 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 10:22:33 GMT</pubDate><ttl>60</ttl><item><title>php调用mssql存储过程。</title><link>http://www.blogjava.net/hexuzhong/archive/2005/09/10/12624.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Sat, 10 Sep 2005 12:17:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/09/10/12624.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/12624.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/09/10/12624.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/12624.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/12624.html</trackback:ping><description><![CDATA[由于某原因，需要用php连接mssql,又由于某些原因需要调用mssql的存储过程(观众：靠！哪来的这么多原因)。<br>
<br>
这里给出实现方法，注释就不多写了，详见php参考手册<br>
<br>
sql server存储过程<br>
<div style="border: 0.5pt solid windowtext; padding: 4px 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 98%;"><div><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">PROCEDURE</span><span style="color: rgb(0, 0, 0);">&nbsp;ProcTest&nbsp;</span><span style="color: rgb(0, 128, 0);">@id</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0); font-weight: bold;">int</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 128, 0);">@name</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0); font-weight: bold;">varchar</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 0, 0); font-weight: bold;">30</span><span style="color: rgb(0, 0, 0);">)&nbsp;output&nbsp;<br></span><span style="color: rgb(0, 0, 255);">AS</span><span style="color: rgb(0, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);">select</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 128, 0);">@name</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 0, 0);">username&nbsp;</span><span style="color: rgb(0, 0, 255);">from</span><span style="color: rgb(0, 0, 0);">&nbsp;mm_user&nbsp;</span><span style="color: rgb(0, 0, 255);">where</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(0, 128, 0);">@id</span><span style="color: rgb(0, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);">select</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">*</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">from</span><span style="color: rgb(0, 0, 0);">&nbsp;mm_user</span></div></div><br>
php实现代码：<br>
<br>
<div style="border: 0.5pt solid windowtext; padding: 4px 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 98%;"><div><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">&lt;?</span><span style="color: rgb(0, 0, 0);">php<br>&nbsp;&nbsp;&nbsp;&nbsp;$userId&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;test&nbsp;parameter</span><span style="color: rgb(0, 128, 0);"><br></span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;$userName;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;test&nbsp;return&nbsp;value</span><span style="color: rgb(0, 128, 0);"><br></span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;$link&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;mssql_connect(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">192.168.1.38</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">sa</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">sa123456a</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)&nbsp;or&nbsp;die(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Can't&nbsp;connect&nbsp;sql&nbsp;server</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;mssql_select_db(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">mm_db</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;$link)&nbsp;or&nbsp;die(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Select&nbsp;database&nbsp;failure</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;$stmt&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;mssql_init(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ProcTest</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;$link)&nbsp;or&nbsp;die(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">initialize&nbsp;stored&nbsp;procedure&nbsp;failure</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;mssql_bind($stmt,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">@id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;$userId,&nbsp;SQLINT4);<br>&nbsp;&nbsp;&nbsp;&nbsp;mssql_bind($stmt,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">@name</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;$userName,&nbsp;SQLVARCHAR,&nbsp;</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;$rs&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;mssql_execute($stmt,&nbsp;</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">do</span><span style="color: rgb(0, 0, 0);">&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">&nbsp;($row&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;mssql_fetch_array($rs))&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;$row[</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">].</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;------&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">.$row[</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">username</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">].</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;------&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">.$row[</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">password</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">].</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;------&nbsp;\r\n&lt;br&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">&nbsp;(mssql_next_result($rs));<br><br>&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">user&nbsp;name&nbsp;is:&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">.$userName;<br></span><span style="color: rgb(0, 0, 0);">?&gt;</span></div></div><br>
<br>
<img src ="http://www.blogjava.net/hexuzhong/aggbug/12624.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-09-10 20:17 <a href="http://www.blogjava.net/hexuzhong/archive/2005/09/10/12624.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP连接Sql Server</title><link>http://www.blogjava.net/hexuzhong/archive/2005/09/10/12623.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Sat, 10 Sep 2005 12:07:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/09/10/12623.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/12623.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/09/10/12623.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/12623.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/12623.html</trackback:ping><description><![CDATA[修改php.ini<br>
1.将;extension=php_mssql.dll前的;号去掉。<br>
2.确认extension_dir为正确路径,以本机为例：extension_dir = "C:\php\extensions"<br>
<br>
ok,重启服务器，测试ing...<br>
<br>
如果不行请尝试下面方法：<br>
<br>
PS：在同学几台电脑上都测试通过，但在自已机器上报错说找不到c:\php\extensions\php_mssql.dll但明明存在这个文件。<br>
<br>
解决方法：<br>
将php_mssql.dll,ntwdblib.dll放到系统目录\system32下重启测试。。。<br>
<br>
（注:上面两个dll文件不在相同目录下，请自已查找。 ^_____^）<br>
<img src ="http://www.blogjava.net/hexuzhong/aggbug/12623.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-09-10 20:07 <a href="http://www.blogjava.net/hexuzhong/archive/2005/09/10/12623.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP版源代码着色类，支持java, javascript</title><link>http://www.blogjava.net/hexuzhong/archive/2005/07/04/7091.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Mon, 04 Jul 2005 07:07:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/07/04/7091.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/7091.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/07/04/7091.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/7091.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/7091.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &lt;?php/**//*&nbsp;*&nbsp;@(#)CodeHighlight.inc.php&nbsp;&nbsp;&nbsp;&nbsp;(beta)&nbsp;&nbsp;&nbsp;&nbsp;2005/7/4&nbsp;*&nbsp;&nbsp;*&nbsp;exBlog源代码着色类，将源代码分析后混合html代码对其着色。&nbsp;*&nbsp;使用方法见代码底部.&nbs...&nbsp;&nbsp;<a href='http://www.blogjava.net/hexuzhong/archive/2005/07/04/7091.html'>阅读全文</a><img src ="http://www.blogjava.net/hexuzhong/aggbug/7091.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-07-04 15:07 <a href="http://www.blogjava.net/hexuzhong/archive/2005/07/04/7091.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RSS2 生成类</title><link>http://www.blogjava.net/hexuzhong/archive/2005/06/08/5735.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Wed, 08 Jun 2005 07:17:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/06/08/5735.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/5735.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/06/08/5735.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/5735.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/5735.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &lt;?php/**//*&nbsp;*&nbsp;@(#)Rss2Gen.inc.php&nbsp;(beta)&nbsp;2005/2/19&nbsp;*&nbsp;&nbsp;*&nbsp;exblog&nbsp;RSS2&nbsp;生成类，实现了RSS2规范中的大部分内容。&nbsp;*&nbsp;&nbsp;*&nbsp;使用方法请见本类底部（Rss2Gen类使用注释）信息。&nbsp...&nbsp;&nbsp;<a href='http://www.blogjava.net/hexuzhong/archive/2005/06/08/5735.html'>阅读全文</a><img src ="http://www.blogjava.net/hexuzhong/aggbug/5735.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-06-08 15:17 <a href="http://www.blogjava.net/hexuzhong/archive/2005/06/08/5735.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP多文件上传类</title><link>http://www.blogjava.net/hexuzhong/archive/2005/06/08/5734.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Wed, 08 Jun 2005 07:16:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/06/08/5734.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/5734.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/06/08/5734.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/5734.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/5734.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&lt;?php/**//*&nbsp;*&nbsp;@(#)UploadFile.php&nbsp;(beta)&nbsp;2005/2/19&nbsp;*&nbsp;&nbsp;*&nbsp;exBlog上传附件类，可同时处理用户多个上传文件。效验文件有效性后存储至指定目录。&nbsp;*&nbsp;可返回上传文件的相关有用信息供其它程序使用。（如文件名、类型、大小、保存路...&nbsp;&nbsp;<a href='http://www.blogjava.net/hexuzhong/archive/2005/06/08/5734.html'>阅读全文</a><img src ="http://www.blogjava.net/hexuzhong/aggbug/5734.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-06-08 15:16 <a href="http://www.blogjava.net/hexuzhong/archive/2005/06/08/5734.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一个在线端口扫瞄器的实现</title><link>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3683.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Sun, 24 Apr 2005 02:18:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3683.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/3683.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3683.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/3683.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/3683.html</trackback:ping><description><![CDATA[<P></P>
<P>作者：&nbsp; HexUzHoNG &lt;<A href="mailto:hexuzhong@gmail.com">hexuzhong@gmail.com</A>&gt;<BR>主页：&nbsp; <A href="http://elliott.126.com/">http://elliott.126.com</A><BR>日期：&nbsp; 2004-1-9</P>
<P>编写原理<BR>^^^^^^^^<BR>&nbsp; + 利用php的fsockopen()进行socket连接<BR>&nbsp; + 利用php的gethostbyname()进行域名转IP<BR>&nbsp; + 利用php的gethostbyaddr()进行IP转域名<BR>&nbsp; + 知道原理编写就非常容易了<BR>&nbsp; + 不足的是该程序不能运行在safe_mode下,速度方面较慢(和superscan,x-scan等比起来像不像小孩的玩具? ^__^)</P>
<P>开始编写<BR>^^^^^^^^<BR>&nbsp; + 只列出关键代码,html就自已修饰吧</P>
<P>&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">####&nbsp;exWebScan.php&nbsp;####<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;?</SPAN><SPAN style="COLOR: #000000">php<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">($_POST[ChangeIp]</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">转换成IP</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_68_152_Open_Image onclick="this.style.display='none'; Codehighlighter1_68_152_Open_Text.style.display='none'; Codehighlighter1_68_152_Closed_Image.style.display='inline'; Codehighlighter1_68_152_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_68_152_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_68_152_Closed_Text.style.display='none'; Codehighlighter1_68_152_Open_Image.style.display='inline'; Codehighlighter1_68_152_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_68_152_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_68_152_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$change</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">@gethostbyname($domain);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">$domain&nbsp;的IP是:$change</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;elseif($_POST[ChangeDomain]</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">转换成域名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_200_268_Open_Image onclick="this.style.display='none'; Codehighlighter1_200_268_Open_Text.style.display='none'; Codehighlighter1_200_268_Closed_Image.style.display='inline'; Codehighlighter1_200_268_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_200_268_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_200_268_Closed_Text.style.display='none'; Codehighlighter1_200_268_Open_Image.style.display='inline'; Codehighlighter1_200_268_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_200_268_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_200_268_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$change</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">@gethostbyaddr($ip);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;echo&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">$ip&nbsp;域名是:$change</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">($_POST[ScanMyself]</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">扫瞄</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_309_487_Open_Image onclick="this.style.display='none'; Codehighlighter1_309_487_Open_Text.style.display='none'; Codehighlighter1_309_487_Closed_Image.style.display='inline'; Codehighlighter1_309_487_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_309_487_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_309_487_Closed_Text.style.display='none'; Codehighlighter1_309_487_Open_Image.style.display='inline'; Codehighlighter1_309_487_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_309_487_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_309_487_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fp</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">fsockopen(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">$MyIp</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">$MyPort</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">$errno,</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">$error,</SPAN><SPAN style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">($fp)<BR><IMG id=Codehighlighter1_389_434_Open_Image onclick="this.style.display='none'; Codehighlighter1_389_434_Open_Text.style.display='none'; Codehighlighter1_389_434_Closed_Image.style.display='inline'; Codehighlighter1_389_434_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_389_434_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_389_434_Closed_Text.style.display='none'; Codehighlighter1_389_434_Open_Image.style.display='inline'; Codehighlighter1_389_434_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;</SPAN><SPAN id=Codehighlighter1_389_434_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_389_434_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;echo&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">$MyIp&nbsp;的&nbsp;$MyPort&nbsp;端口是&nbsp;打开&nbsp;的!</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_443_481_Open_Image onclick="this.style.display='none'; Codehighlighter1_443_481_Open_Text.style.display='none'; Codehighlighter1_443_481_Closed_Image.style.display='inline'; Codehighlighter1_443_481_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_443_481_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_443_481_Closed_Text.style.display='none'; Codehighlighter1_443_481_Open_Image.style.display='inline'; Codehighlighter1_443_481_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;</SPAN><SPAN id=Codehighlighter1_443_481_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_443_481_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;echo&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">$MyIp&nbsp;的&nbsp;$MyPort&nbsp;端口是&nbsp;关闭&nbsp;的!</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">?&gt;</SPAN></DIV></DIV><BR><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">form&nbsp;</SPAN><SPAN style="COLOR: #ff0000">method</SPAN><SPAN style="COLOR: #0000ff">="post"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;action</SPAN><SPAN style="COLOR: #0000ff">="&lt;?&nbsp;echo&nbsp;$PHP_SELF;&nbsp;?&gt;"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>域名转换IP:&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="domain"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="submit"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="转换成IP"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="ChangeIp"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>IP转域名:&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="ip"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="submit"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="转换成域名"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="ChangeDomain"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>自定义端口扫瞄:<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>IP&nbsp;Address:&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="MyIp"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>Port&nbsp;list:&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="MyPort"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;size</SPAN><SPAN style="COLOR: #0000ff">="8"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="submit"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="扫瞄"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="ScanMyself"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">form</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>说明<BR>^^^^<BR>&nbsp; + 该webscan实现了最简单扫瞄,如果您有兴趣可以自行修改让功能更多更实用<BR>&nbsp; + 可以做一个常用木马端口扫瞄项,把相关端口放到一个array中,然后用循环扫瞄&amp;显示<BR>&nbsp; + 可以做一个网段扫瞄或一个IP多端口扫瞄等等<BR>&nbsp; + 再多了是不是华而不实了? ^__^<BR>&nbsp; + 本文可能有写错之处,如果请改正.Thanks.</P><img src ="http://www.blogjava.net/hexuzhong/aggbug/3683.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-04-24 10:18 <a href="http://www.blogjava.net/hexuzhong/archive/2005/04/24/3683.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>win2000下安装apache2+php+mysql</title><link>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3682.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Sun, 24 Apr 2005 02:16:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3682.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/3682.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3682.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/3682.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/3682.html</trackback:ping><description><![CDATA[<P>Author: HexUzHoNG<BR>Sort:&nbsp;&nbsp; 学习笔记<BR>Time:&nbsp;&nbsp; 2004-2-8</P>
<P>安装apache2<BR>^^^^^^^^^^^<BR>&nbsp; + 解压后安装(以我的安装为例: g:\webServer\apache2)<BR>&nbsp; + 设置好路径后一路NEXT,OK安装完成.<BR>&nbsp; + 打开ie <A href="http://127.0.0.1">http://127.0.0.1</A> 看到默认首页就OK. httpd.cnf等下再配置.</P>
<P>安装php<BR>^^^^^^^<BR>&nbsp; + 解压.rar(以我的安装为例: g:\webServer\php)<BR>&nbsp; + 把 php.ini-dist 复制到 c:\winnt\ 下,并重命名 php.ini<BR>&nbsp; + 编辑 php.ini 找到 doc_root = G:\website\www (这一步记得好像在老版本中不要修改??)<BR>&nbsp; + 把 php4ts.dll 复制到 c:\winnt\system32\ 下<BR>&nbsp; + 打开 g:\webServer\apache2\conf\ 编辑 httpd.conf 在最后面加入以下内容</P>
<P>--------------------------------------------------------<BR># Myself's config</P>
<P>AdddefaultCharset GB2312<BR>DirectoryIndex index.php <BR>ScriptAlias /php/ "g:/webServer/php/"<BR>AddType application/x-httpd-php .php<BR>Action application/x-httpd-php "/php/php.exe"<BR>--------------------------------------------------------<BR>第一行添加默认字符 GB2312 使可以正常显示中文<BR>第二行把index.php成为默认首页面<BR>第二行让/php/成为g:/webServer/php/的脚本别名<BR>第四行添加一个类型让服务器认识.php的后缀名<BR>第五行激活php解释器 (以上有可能理解有误,我是这么理解的 ^!^)<BR>然后搜索 DocumentRoot 把这一项改为 DocumentRoot "G:/website/www"<BR>上面这一行是设置文档路径,偶没有用默认的,这一行要和 php.ini 中 doc_root 一样</P>
<P>&nbsp; + ok,差不多了<BR>&nbsp;<BR>安装mysql<BR>^^^^^^^^^<BR>&nbsp; + 解压后运行setup.exe(以我的安装为例: g:\webServer\mysql)<BR>&nbsp; + 然后在命令行进入mysql\bin\目录下,运行 mysqld.exe --standalone 启动服务<BR>&nbsp; + 运行 mysqladmin ping 回显 mysqld is alive 运行成功<BR>&nbsp; + 你也可以运行 mysqld-nt.exe --install 使 mysql 成为win2000的系统服务</P>
<P>测试<BR>^^^^^<BR>&nbsp; + 如果要使用session,还须在g:\下建立一 tmp 目录 apache2 安装根目录<BR>&nbsp; + 在 g:\website\www\ 下建一个 info.php ,内容为 &lt;? phpinfo(); ?&gt;<BR>&nbsp; + 出现 PHP 相关配置信息就OK了</P>
<P>参考我的错误<BR>^^^^^^^^^^^^^<BR>&nbsp; + 注意以上路径是本人安装的路径,在你安装时须适当修改<BR>&nbsp; + 运行 info.php 说找不到该页面,但写入一个 .txt 内容又能显示<BR>&nbsp;&nbsp;&nbsp; 由于没在 c:\winnt\php.ini 中修改 doc_root = <BR>&nbsp; + MYSQL 启动不了<BR>&nbsp;&nbsp;&nbsp; 由于以前安装了个 easyphp ,在 C:\winnt\ 下写入了 my.ini ,安装mysql时,只在my.ini后追加了内容,所以启动错误<BR>&nbsp;&nbsp;&nbsp; 删除 easyphp ,再安装 mysql 就OK<BR></P><img src ="http://www.blogjava.net/hexuzhong/aggbug/3682.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-04-24 10:16 <a href="http://www.blogjava.net/hexuzhong/archive/2005/04/24/3682.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>◆ 用PHP结合apache做一个简单的目录认证功能</title><link>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3678.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Sun, 24 Apr 2005 02:12:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3678.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/3678.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2005/04/24/3678.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/3678.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/3678.html</trackback:ping><description><![CDATA[<P>作者：&nbsp; HexUzHoNG&lt;<A href="mailto:hexuzhong@gmail.com">hexuzhong@gmail.com</A>&gt;<BR>日期：&nbsp; 2004-1-9</P>
<P>编写思路<BR>^^^^^^^^^<BR>&nbsp; + 该程序运行在php&amp;apache环境中,无须修改服务器配置.<BR>&nbsp; + 利用php的header()函数向apache服务器发送一条目录认证请求.<BR>&nbsp; + 然后取得用户名,密码和文本或mysql数据库中相关数据对比.通过则PASS,否则BAN&nbsp; ^__^<BR>&nbsp; + 不足之处是在页面传递信息时密码是以base64方式加密.</P>
<P>开始编写<BR>^^^^^^^^^<BR>&nbsp; + 首先用Header('WWW-authenticate: basic realm="Web Manager"');向服务器发送一条认证请求,<BR>&nbsp;&nbsp;&nbsp; WEB服务器接收到认证请求后,会弹出一个对话框来接收用户的输入.<BR>&nbsp; + PHP可以利用$PHP_AUTH_USER,$PHP_AUTH_PW来接收用户名和密码两个变量值.</P>
<P>&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">####&nbsp;check.php&nbsp;####<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;?</SPAN><SPAN style="COLOR: #000000">php<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">($PHP_AUTH_USER</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;$PHP_AUTH_PW</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">)&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">---&nbsp;如果认证框返回值都为空,则发送认证请求</SPAN><SPAN style="COLOR: #008000"><BR><IMG id=Codehighlighter1_98_248_Open_Image onclick="this.style.display='none'; Codehighlighter1_98_248_Open_Text.style.display='none'; Codehighlighter1_98_248_Closed_Image.style.display='inline'; Codehighlighter1_98_248_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_98_248_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_98_248_Closed_Text.style.display='none'; Codehighlighter1_98_248_Open_Image.style.display='inline'; Codehighlighter1_98_248_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_98_248_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_98_248_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Header(</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">WWW-authenticate:&nbsp;basic&nbsp;realm="Web&nbsp;Manager"</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">);&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">---&nbsp;Web&nbsp;Manager是描述信息,可修改.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;Header(</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">HTTP/1.0&nbsp;401&nbsp;Unauthorized</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR><IMG id=Codehighlighter1_253_643_Open_Image onclick="this.style.display='none'; Codehighlighter1_253_643_Open_Text.style.display='none'; Codehighlighter1_253_643_Closed_Image.style.display='inline'; Codehighlighter1_253_643_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_253_643_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_253_643_Closed_Text.style.display='none'; Codehighlighter1_253_643_Open_Image.style.display='inline'; Codehighlighter1_253_643_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN id=Codehighlighter1_253_643_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_253_643_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;require(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">./config.inc.php</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">---&nbsp;载入用户配置文件</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;$user</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">strtolower($PHP_AUTH_USER);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">---&nbsp;将用户名转换为小写</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;$passwd</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">$PHP_AUTH_PW;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">---&nbsp;如果用户名或密码不正确则重新发送认证请求&nbsp;---</SPAN><SPAN style="COLOR: #008000">//<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">($exWeb[admin]&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;$user&nbsp;</SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000">&nbsp;$exWeb[password]&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;$passwd)<BR><IMG id=Codehighlighter1_509_641_Open_Image onclick="this.style.display='none'; Codehighlighter1_509_641_Open_Text.style.display='none'; Codehighlighter1_509_641_Closed_Image.style.display='inline'; Codehighlighter1_509_641_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_509_641_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_509_641_Closed_Text.style.display='none'; Codehighlighter1_509_641_Open_Image.style.display='inline'; Codehighlighter1_509_641_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_509_641_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_509_641_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Header(</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">WWW-authenticate:&nbsp;basic&nbsp;realm="Web&nbsp;Manager"</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Header(</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">HTTP/1.0&nbsp;401&nbsp;Unauthorized</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>####&nbsp;config.inc.php&nbsp;####<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;?</SPAN><SPAN style="COLOR: #000000">php<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>$exWeb[admin]</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">elliott</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">管理员用户名</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">$exWeb[password]</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">123456</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">管理员密码</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;</P>
<P>说明<BR>^^^^^<BR>&nbsp; + 只须在待验证的文件头加入&lt;? require("./check.php"); ?&gt;即可.<BR>&nbsp; + 本文可能有写错之处,如果请改正.Thanks.<BR></P><img src ="http://www.blogjava.net/hexuzhong/aggbug/3678.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2005-04-24 10:12 <a href="http://www.blogjava.net/hexuzhong/archive/2005/04/24/3678.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>