PHP探针【转载】

学习笔记 马富天 2018-04-27 10:50:25 97 1

【摘要】介绍一款主流的PHP探针,本文转载自其它来源。

效果图如下:

请输入图片名称
  1. <?php
  2. error_reporting(0); //抑制所有错误信息
  3. @header("content-Type: text/html; charset=utf-8"); //语言强制
  4. ob_start();
  5. function valid_email($str) 
  6. {
  7. 	return ( ! preg_match("/^([a-z0-9+_-]+)(.[a-z0-9+_-]+)*@([a-z0-9-]+.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
  8. }
  9. //检测PHP设置参数
  10. function show($varName)
  11. {
  12. 	switch($result = get_cfg_var($varName))
  13. 	{
  14. 		case 0:
  15. 			return '<font color="red">×</font>';
  16. 		break;
  17. 		
  18. 		case 1:
  19. 			return '<font color="green">√</font>';
  20. 		break;
  21. 		
  22. 		default:
  23. 			return $result;
  24. 		break;
  25. 	}
  26. }
  27. if ($_GET['act'] == "phpinfo") 
  28. {
  29. 	phpinfo();
  30. 	exit();
  31. } 
  32. elseif($_GET['act'] == "Function")
  33. {
  34. 	$arr = get_defined_functions();
  35. 	Function php()
  36. 	{
  37. 	}
  38. 	echo "<pre>";
  39. 	Echo "这里显示系统所支持的所有函数,和自定义函数n";
  40. 	print_r($arr);
  41. 	echo "</pre>";
  42. 	exit();
  43. }elseif($_GET['act'] == "disable_functions")
  44. {
  45. 	$disFuns=get_cfg_var("disable_functions");
  46. 	if(empty($disFuns))
  47. 	{
  48. 		$arr = '<font color=red>×</font>';
  49. 	}
  50. 	else
  51. 	{ 
  52. 		$arr = $disFuns;
  53. 	}
  54. 	Function php()
  55. 	{
  56. 	}
  57. 	echo "<pre>";
  58. 	Echo "这里显示系统被禁用的函数n";
  59. 	print_r($arr);
  60. 	echo "</pre>";
  61. 	exit();
  62. }
  63. //MySQL检测
  64. if ($_POST['act'] == 'MySQL检测')
  65. {
  66. 	$host = isset($_POST['host']) ? trim($_POST['host']) : '';
  67. 	$port = isset($_POST['port']) ? (int) $_POST['port'] : '';
  68. 	$login = isset($_POST['login']) ? trim($_POST['login']) : '';
  69. 	$password = isset($_POST['password']) ? trim($_POST['password']) : '';
  70. 	$host = preg_match('~[^a-z0-9-.]+~i', $host) ? '' : $host;
  71. 	$port = intval($port) ? intval($port) : '';
  72. 	$login = preg_match('~[^a-z0-9_-]+~i', $login) ? '' : htmlspecialchars($login);
  73. 	$password = is_string($password) ? htmlspecialchars($password) : '';
  74. }
  75. elseif ($_POST['act'] == '函数检测')
  76. {
  77. 	$funRe = "函数".$_POST['funName']."支持状况检测结果:".isfun1($_POST['funName']);
  78. } 
  79. elseif ($_POST['act'] == '邮件检测')
  80. {
  81. 	$mailRe = "邮件发送检测结果:发送";
  82. 	if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);}
  83. 	else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);}
  84. 	$mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!nnhttp://lnmp.org")) ? "完成":"失败";
  85. }	
  86. 	
  87. // 检测函数支持
  88. function isfun($funName = '')
  89. {
  90.     if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9_]+~i', $funName, $tmp)) return '错误';
  91. 	return (false !== function_exists($funName)) ? '<font color="green">√</font>' : '<font color="red">×</font>';
  92. }
  93. function isfun1($funName = '')
  94. {
  95.     if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9_]+~i', $funName, $tmp)) return '错误';
  96. 	return (false !== function_exists($funName)) ? '√' : '×';
  97. }
  98. ?>
  99. <!DOCTYPE html>
  100. <html>
  101.   <head>
  102.   <title>探针 2014 </title>
  103.   <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  104.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  105.   <style type="text/css">
  106.     <!--
  107.     * {font-family: Tahoma, "Microsoft Yahei", Arial; }
  108.     body{text-align: center; margin: 0 auto; padding: 0; background-color:#FFFFFF;font-size:12px;font-family:Tahoma, Arial}
  109.     h1 {font-size: 26px; font-weight: normal; padding: 0; margin: 0; color: #444444;}
  110.     h1 small {font-size: 11px; font-family: Tahoma; font-weight: bold; }
  111.     a{color: #000000; text-decoration:none;}
  112.     a.black{color: #000000; text-decoration:none;}
  113.     b{color: #999999;}
  114.     table{clear:both;padding: 0; margin: 0 0 10px;border-collapse:collapse; border-spacing: 0;}
  115.     th{padding: 3px 6px; font-weight:bold;background:#3066a6;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
  116.     .th_1{padding: 3px 6px; font-weight:bold;background:#666699;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
  117.     tr{padding: 0; background:#F7F7F7;}
  118.     td{padding: 3px 6px; border:1px solid #CCCCCC;}
  119.     input{padding: 2px; background: #FFFFFF; border-top:1px solid #666666; border-left:1px solid #666666; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; font-size:12px}
  120.     input.btn{font-weight: bold; height: 20px; line-height: 20px; padding: 0 6px; color:#666666; background: #f2f2f2; border:1px solid #999;font-size:12px}
  121.     .bar {border:1px solid #999999; background:#FFFFFF; height:5px; font-size:2px; width:89%; margin:2px 0 5px 0;padding:1px;overflow: hidden;}
  122.     .bar_1 {border:1px dotted #999999; background:#FFFFFF; height:5px; font-size:2px; width:89%; margin:2px 0 5px 0;padding:1px;overflow: hidden;}
  123.     .barli_red{background:#ff6600; height:5px; margin:0px; padding:0;}
  124.     .barli_blue{background:#0099FF; height:5px; margin:0px; padding:0;}
  125.     .barli_green{background:#36b52a; height:5px; margin:0px; padding:0;}
  126.     .barli_1{background:#999999; height:5px; margin:0px; padding:0;}
  127.     .barli{background:#36b52a; height:5px; margin:0px; padding:0;}
  128.     #page {width: 920px; padding: 0 20px; margin: 0 auto; text-align: left;}
  129.     #header{position: relative; padding: 10px;}
  130.     #footer {padding: 15px 15px; text-align: left; font-size: 12px; font-family: Tahoma, Verdana;line-height:16px}
  131.     #lnmplink {position: absolute; top: 20px; left: 200px; text-align: right; font-weight: bold; color: #06C;}
  132.     #lnmplink a {color: #0000FF; text-decoration: underline;}
  133.     #lnmplink2 {position: absolute; top: 20px; right: 80px; text-align: right; font-weight: bold; color: #06C;}
  134.     #lnmplink2 a {color: #0000FF; text-decoration: underline;}
  135.     .w_small{font-family: Courier New;}
  136.     .w_number{color: #f800fe;}
  137.     .sudu {padding: 0; background:#5dafd1; }
  138.     .suduk { margin:0px; padding:0;}
  139.     .resNo{color: #FF0000;}
  140.     .word{word-break:break-all;}
  141.     -->
  142.   </style>
  143.   </head>
  144. <body>
  145. <div id="page">
  146. <!--服务器相关参数-->
  147. <table width="100%" cellpadding="3" cellspacing="0">
  148.   <tr><th colspan="4">服务器参数</th></tr>
  149.   <tr>
  150.     <td>服务器域名/IP地址</td>
  151.     <td colspan="3"><?php echo $_SERVER['SERVER_NAME'];?>(<?php if('/'==DIRECTORY_SEPARATOR){echo $_SERVER['SERVER_ADDR'];}else{echo @gethostbyname($_SERVER['SERVER_NAME']);} ?>)</td>
  152.   </tr>
  153.   <tr>
  154.     <td>服务器标识</td>
  155.     <td colspan="3"><?php if($sysInfo['win_n'] != ''){echo $sysInfo['win_n'];}else{echo @php_uname();};?></td>
  156.   </tr>
  157.   <tr>
  158.     <td width="13%">服务器操作系统</td>
  159.     <td width="37%"><?php $os = explode(" ", php_uname()); echo $os[0];?> &nbsp;内核版本:<?php if('/'==DIRECTORY_SEPARATOR){echo $os[2];}else{echo $os[1];} ?></td>
  160.     <td width="13%">服务器解译引擎</td>
  161.     <td width="37%"><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
  162.   </tr>
  163.   <tr>
  164.     <td>服务器语言</td>
  165.     <td><?php echo getenv("HTTP_ACCEPT_LANGUAGE");?></td>
  166.     <td>服务器端口</td>
  167.     <td><?php echo $_SERVER['SERVER_PORT'];?></td>
  168.   </tr>
  169.   <tr>
  170. 	  <td>服务器主机名</td>
  171. 	  <td><?php if('/'==DIRECTORY_SEPARATOR ){echo $os[1];}else{echo $os[2];} ?></td>
  172. 	  <td>绝对路径</td>
  173. 	  <td><?php echo $_SERVER['DOCUMENT_ROOT']?str_replace('\','/',$_SERVER['DOCUMENT_ROOT']):str_replace('\','/',dirname(__FILE__));?></td>
  174. 	</tr>
  175.   <tr>
  176. 	  <td>管理员邮箱</td>
  177. 	  <td><?php echo $_SERVER['SERVER_ADMIN'];?></td>
  178. 		<td>探针路径</td>
  179. 		<td><?php echo str_replace('\','/',__FILE__)?str_replace('\','/',__FILE__):$_SERVER['SCRIPT_FILENAME'];?></td>
  180. 	</tr>
  181. </table>
  182. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  183.   <tr>
  184.     <th colspan="4">PHP已编译模块检测</th>
  185.   </tr>
  186.   <tr>
  187.     <td colspan="4"><span class="w_small">
  188. <?php
  189. $able=get_loaded_extensions();
  190. foreach ($able as $key=>$value) {
  191. 	if ($key!=0 && $key==0) {
  192. 		echo '<br />';
  193. 	}
  194. 	echo "$value&nbsp;&nbsp;";
  195. }
  196. ?></span>
  197.     </td>
  198.   </tr>
  199. </table>
  200. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  201.   <tr><th colspan="4">PHP相关参数</th></tr>
  202.   <tr>
  203.     <td width="32%">PHP信息(phpinfo):</td>
  204.     <td width="18%">
  205. 		<?php
  206. 		$phpSelf = $_SERVER[PHP_SELF] ? $_SERVER[PHP_SELF] : $_SERVER[SCRIPT_NAME];
  207. 		$disFuns=get_cfg_var("disable_functions");
  208. 		?>
  209.     <?php echo (false!==eregi("phpinfo",$disFuns))? '<font color="red">×</font>' :"<a href='/$phpSelf/act/phpinfo.html' target='_blank'>PHPINFO</a>";?>
  210.     </td>
  211.     <td width="32%">PHP版本(php_version):</td>
  212.     <td width="18%"><?php echo PHP_VERSION;?></td>
  213.   </tr>
  214.   <tr>
  215.     <td>PHP运行方式:</td>
  216.     <td><?php echo strtoupper(php_sapi_name());?></td>
  217.     <td>脚本占用最大内存(memory_limit):</td>
  218.     <td><?php echo show("memory_limit");?></td>
  219.   </tr>
  220.   <tr>
  221.     <td>PHP安全模式(safe_mode):</td>
  222.     <td><?php echo show("safe_mode");?></td>
  223.     <td>POST方法提交最大限制(post_max_size):</td>
  224.     <td><?php echo show("post_max_size");?></td>
  225.   </tr>
  226.   <tr>
  227.     <td>上传文件最大限制(upload_max_filesize):</td>
  228.     <td><?php echo show("upload_max_filesize");?></td>
  229.     <td>浮点型数据显示的有效位数(precision):</td>
  230.     <td><?php echo show("precision");?></td>
  231.   </tr>
  232.   <tr>
  233.     <td>脚本超时时间(max_execution_time):</td>
  234.     <td><?php echo show("max_execution_time");?>秒</td>
  235.     <td>socket超时时间(default_socket_timeout):</td>
  236.     <td><?php echo show("default_socket_timeout");?>秒</td>
  237.   </tr>
  238.   <tr>
  239.     <td>PHP页面根目录(doc_root):</td>
  240.     <td><?php echo show("doc_root");?></td>
  241.     <td>用户根目录(user_dir):</td>
  242.     <td><?php echo show("user_dir");?></td>
  243.   </tr>
  244.   <tr>
  245.     <td>dl()函数(enable_dl):</td>
  246.     <td><?php echo show("enable_dl");?></td>
  247.     <td>指定包含文件目录(include_path):</td>
  248.     <td><?php echo show("include_path");?></td>
  249.   </tr>
  250.   <tr>
  251.     <td>显示错误信息(display_errors):</td>
  252.     <td><?php echo show("display_errors");?></td>
  253.     <td>自定义全局变量(register_globals):</td>
  254.     <td><?php echo show("register_globals");?></td>
  255.   </tr>
  256.   <tr>
  257.     <td>数据反斜杠转义(magic_quotes_gpc):</td>
  258.     <td><?php echo show("magic_quotes_gpc");?></td>
  259.     <td>"&lt;?...?&gt;"短标签(short_open_tag):</td>
  260.     <td><?php echo show("short_open_tag");?></td>
  261.   </tr>
  262.   <tr>
  263.     <td>"&lt;% %&gt;"ASP风格标记(asp_tags):</td>
  264.     <td><?php echo show("asp_tags");?></td>
  265.     <td>忽略重复错误信息(ignore_repeated_errors):</td>
  266.     <td><?php echo show("ignore_repeated_errors");?></td>
  267.   </tr>
  268.   <tr>
  269.     <td>忽略重复的错误源(ignore_repeated_source):</td>
  270.     <td><?php echo show("ignore_repeated_source");?></td>
  271.     <td>报告内存泄漏(report_memleaks):</td>
  272.     <td><?php echo show("report_memleaks");?></td>
  273.   </tr>
  274.   <tr>
  275.     <td>自动字符串转义(magic_quotes_gpc):</td>
  276.     <td><?php echo show("magic_quotes_gpc");?></td>
  277.     <td>外部字符串自动转义(magic_quotes_runtime):</td>
  278.     <td><?php echo show("magic_quotes_runtime");?></td>
  279.   </tr>
  280.   <tr>
  281.     <td>打开远程文件(allow_url_fopen):</td>
  282.     <td><?php echo show("allow_url_fopen");?></td>
  283.     <td>声明argv和argc变量(register_argc_argv):</td>
  284.     <td><?php echo show("register_argc_argv");?></td>
  285.   </tr>
  286.   <tr>
  287.     <td>Cookie 支持:</td>
  288.     <td><?php echo isset($_COOKIE)?'<font color="green">√</font>' : '<font color="red">×</font>';?></td>
  289.     <td>拼写检查(ASpell Library):</td>
  290.     <td><?php echo isfun("aspell_check_raw");?></td>
  291.   </tr>
  292.    <tr>
  293.     <td>高精度数学运算(BCMath):</td>
  294.     <td><?php echo isfun("bcadd");?></td>
  295.     <td>PREL相容语法(PCRE):</td>
  296.     <td><?php echo isfun("preg_match");?></td>
  297.    <tr>
  298.     <td>PDF文档支持:</td>
  299.     <td><?php echo isfun("pdf_close");?></td>
  300.     <td>SNMP网络管理协议:</td>
  301.     <td><?php echo isfun("snmpget");?></td>
  302.   </tr> 
  303.    <tr>
  304.     <td>VMailMgr邮件处理:</td>
  305.     <td><?php echo isfun("vm_adduser");?></td>
  306.     <td>Curl支持:</td>
  307.     <td><?php echo isfun("curl_init");?></td>
  308.   </tr> 
  309.    <tr>
  310.     <td>SMTP支持:</td>
  311.     <td><?php echo get_cfg_var("SMTP")?'<font color="green">√</font>' : '<font color="red">×</font>';?></td>
  312.     <td>SMTP地址:</td>
  313.     <td><?php echo get_cfg_var("SMTP")?get_cfg_var("SMTP"):'<font color="red">×</font>';?></td>
  314.   </tr> 
  315. 	<tr>
  316. 		<td>默认支持函数(enable_functions):</td>
  317. 		<td colspan="3"><a href='/</php echo $phpSelf;/gt;act/Function.html' target='_blank' class='static'>请点这里查看详细!</a></td>		
  318. 	</tr>
  319. 	<tr>
  320. 		<td>被禁用的函数(disable_functions):</td>
  321. 		<td colspan="3" class="word">
  322. <?php 
  323. $disFuns=get_cfg_var("disable_functions");
  324. if(empty($disFuns))
  325. {
  326. 	echo '<font color=red>×</font>';
  327. }
  328. else
  329. { 
  330. 	//echo $disFuns;
  331. 	$disFuns_array =  explode(',',$disFuns);
  332. 	foreach ($disFuns_array as $key=>$value) 
  333. 	{
  334. 		if ($key!=0 && $key%5==0) {
  335. 			echo '<br />';
  336. 	}
  337. 	echo "$value&nbsp;&nbsp;";
  338. }	
  339. }
  340. ?>
  341. 		</td>
  342. 	</tr>
  343. </table>
  344. <!--组件信息-->
  345. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  346.   <tr><th colspan="4" >组件支持</th></tr>
  347.   <tr>
  348.     <td width="32%">FTP支持:</td>
  349.     <td width="18%"><?php echo isfun("ftp_login");?></td>
  350.     <td width="32%">XML解析支持:</td>
  351.     <td width="18%"><?php echo isfun("xml_set_object");?></td>
  352.   </tr>
  353.   <tr>
  354.     <td>Session支持:</td>
  355.     <td><?php echo isfun("session_start");?></td>
  356.     <td>Socket支持:</td>
  357.     <td><?php echo isfun("socket_accept");?></td>
  358.   </tr>
  359.   <tr>
  360.     <td>Calendar支持</td>
  361.     <td><?php echo isfun('cal_days_in_month');?>
  362. 	</td>
  363.     <td>允许URL打开文件:</td>
  364.     <td><?php echo show("allow_url_fopen");?></td>
  365.   </tr>
  366.   <tr>
  367.     <td>GD库支持:</td>
  368.     <td>
  369.     <?php
  370.         if(function_exists(gd_info)) {
  371.             $gd_info = @gd_info();
  372. 	        echo $gd_info["GD Version"];
  373. 	    }else{echo '<font color="red">×</font>';}
  374. 	?></td>
  375.     <td>压缩文件支持(Zlib):</td>
  376.     <td><?php echo isfun("gzclose");?></td>
  377.   </tr>
  378.   <tr>
  379.     <td>IMAP电子邮件系统函数库:</td>
  380.     <td><?php echo isfun("imap_close");?></td>
  381.     <td>历法运算函数库:</td>
  382.     <td><?php echo isfun("JDToGregorian");?></td>
  383.   </tr>
  384.   <tr>
  385.     <td>正则表达式函数库:</td>
  386.     <td><?php echo isfun("preg_match");?></td>
  387.     <td>WDDX支持:</td>
  388.     <td><?php echo isfun("wddx_add_vars");?></td>
  389.   </tr>
  390.   <tr>
  391.     <td>Iconv编码转换:</td>
  392.     <td><?php echo isfun("iconv");?></td>
  393.     <td>mbstring:</td>
  394.     <td><?php echo isfun("mb_eregi");?></td>
  395.   </tr>
  396.   <tr>
  397.     <td>高精度数学运算:</td>
  398.     <td><?php echo isfun("bcadd");?></td>
  399.     <td>LDAP目录协议:</td>
  400.     <td><?php echo isfun("ldap_close");?></td>
  401.   </tr>
  402.   <tr>
  403.     <td>MCrypt加密处理:</td>
  404.     <td><?php echo isfun("mcrypt_cbc");?></td>
  405.     <td>哈稀计算:</td>
  406.     <td><?php echo isfun("mhash_count");?></td>
  407.   </tr>
  408. </table>
  409. <!--第三方组件信息-->
  410. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  411.   <tr><th colspan="4" >第三方组件</th></tr>
  412.   <tr>
  413.     <td width="32%">Zend版本</td>
  414.     <td width="18%"><?php $zend_version = zend_version();if(empty($zend_version)){echo '<font color=red>×</font>';}else{echo $zend_version;}?></td>
  415.     <td width="32%">
  416. <?php
  417. $PHP_VERSION = PHP_VERSION;
  418. $PHP_VERSION = substr($PHP_VERSION,2,1);
  419. if($PHP_VERSION > 2)
  420. {
  421. 	echo "ZendGuardLoader[启用]";
  422. }
  423. else
  424. {
  425. 	echo "Zend Optimizer";
  426. }
  427. ?>
  428. 	</td>
  429.     <td width="18%"><?php if($PHP_VERSION > 2){echo (get_cfg_var("zend_loader.enable"))?'<font color=green>√</font>':'<font color=red>×</font>';} else{if(function_exists('zend_optimizer_version')){	echo zend_optimizer_version();}else{	echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'<font color=green>√</font>':'<font color=red>×</font>';}}?></td>
  430.   </tr>
  431.   <tr>
  432.     <td>eAccelerator</td>
  433.     <td><?php if((phpversion('eAccelerator'))!=''){echo phpversion('eAccelerator');}else{ echo "<font color=red>×</font>";} ?></td>
  434.     <td>ioncube</td>
  435.     <td><?php if(extension_loaded('ionCube Loader')){   $ys = ioncube_loader_iversion();   $gm = ".".(int)substr($ys,3,2);   echo ionCube_Loader_version().$gm;}else{echo "<font color=red>×</font>";}?></td>
  436.   </tr>
  437.   <tr>
  438.     <td>XCache</td>
  439.     <td><?php if((phpversion('XCache'))!=''){echo phpversion('XCache');}else{ echo "<font color=red>×</font>";} ?></td>
  440.     <td>APC</td>
  441.     <td><?php if((phpversion('APC'))!=''){echo phpversion('APC');}else{ echo "<font color=red>×</font>";} ?></td>
  442.   </tr>
  443. </table>
  444. <!--数据库支持-->
  445. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  446.   <tr><th colspan="4">数据库支持</th></tr>
  447.   <tr>
  448.     <td width="32%">MySQL 数据库:</td>
  449.     <td width="18%"><?php echo isfun("mysql_close");?>
  450.     <?php
  451.     if(function_exists("mysql_get_server_info")) {
  452.         $s = @mysql_get_server_info();
  453.         $s = $s ? '&nbsp; mysql_server 版本:'.$s : '';
  454. 	    $c = '&nbsp; mysql_client 版本:'.@mysql_get_client_info();
  455.         echo $s;
  456.     }
  457.     ?>
  458. 	</td>
  459.     <td width="32%">ODBC 数据库:</td>
  460.     <td width="18%"><?php echo isfun("odbc_close");?></td>
  461.   </tr>
  462.   <tr>
  463.     <td>Oracle 数据库:</td>
  464.     <td><?php echo isfun("ora_close");?></td>
  465.     <td>SQL Server 数据库:</td>
  466.     <td><?php echo isfun("mssql_close");?></td>
  467.   </tr>
  468.   <tr>
  469.     <td>dBASE 数据库:</td>
  470.     <td><?php echo isfun("dbase_close");?></td>
  471.     <td>mSQL 数据库:</td>
  472.     <td><?php echo isfun("msql_close");?></td>
  473.   </tr>
  474.   <tr>
  475.     <td>SQLite 数据库:</td>
  476.     <td><?php if(extension_loaded('sqlite3')) {$sqliteVer = SQLite3::version();echo '<font color=green>√</font> ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '<font color="green">√</font>') {echo "&nbsp; 版本: ".@sqlite_libversion();}}?></td>
  477.     <td>Hyperwave 数据库:</td>
  478.     <td><?php echo isfun("hw_close");?></td>
  479.   </tr>
  480.   <tr>
  481.     <td>Postgre SQL 数据库:</td>
  482.     <td><?php echo isfun("pg_close"); ?></td>
  483.     <td>Informix 数据库:</td>
  484.     <td><?php echo isfun("ifx_close");?></td>
  485.   </tr>
  486.   <tr>
  487.     <td>DBA 数据库:</td>
  488.     <td><?php echo isfun("dba_close");?></td>
  489.     <td>DBM 数据库:</td>
  490.     <td><?php echo isfun("dbmclose");?></td>
  491.   </tr>
  492.   <tr>
  493.     <td>FilePro 数据库:</td>
  494.     <td><?php echo isfun("filepro_fieldcount");?></td>
  495.     <td>SyBase 数据库:</td>
  496.     <td><?php echo isfun("sybase_close");?></td>
  497.   </tr> 
  498. </table>
  499. <form action="<?php echo $_SERVER[PHP_SELF]."#bottom";?>" method="post">
  500. <!--MySQL数据库连接检测-->
  501. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  502. 	<tr><th colspan="3">MySQL数据库连接检测</th></tr>
  503.   <tr>
  504.     <td width="15%"></td>
  505.     <td width="60%">
  506.       地址:<input type="text" name="host" value="localhost" size="10" />
  507.       端口:<input type="text" name="port" value="3306" size="10" />
  508.       用户名:<input type="text" name="login" size="10" />
  509.       密码:<input type="password" name="password" size="10" />
  510.     </td>
  511.     <td width="25%">
  512.       <input class="btn" type="submit" name="act" value="MySQL检测" />
  513.     </td>
  514.   </tr>
  515. </table>
  516.   <?php
  517.   if ($_POST['act'] == 'MySQL检测') {
  518.   	if(function_exists("mysql_close")==1) {
  519.   		$link = @mysql_connect($host.":".$port,$login,$password);
  520.   		if ($link){
  521.   			echo "<script>alert('连接到MySql数据库正常')</script>";
  522.   		} else {
  523.   			echo "<script>alert('无法连接到MySql数据库!')</script>";
  524.   		}
  525.   	} else {
  526.   		echo "<script>alert('服务器不支持MySQL数据库!')</script>";
  527.   	}
  528.   }
  529. 	?>
  530. <!--函数检测-->
  531. <table width="100%" cellpadding="3" cellspacing="0" align="center">
  532. 	<tr><th colspan="3">函数检测</th></tr>
  533.   <tr>
  534.     <td width="15%"></td>
  535.     <td width="60%">
  536.       请输入您要检测的函数:
  537.       <input type="text" name="funName" size="50" />
  538.     </td>
  539.     <td width="25%">
  540.       <input class="btn" type="submit" name="act" align="right" value="函数检测" />
  541.     </td>
  542.   </tr>
  543.   <?php
  544.   if ($_POST['act'] == '函数检测') {
  545.   	echo "<script>alert('$funRe')</script>";
  546.   }
  547.   ?>
  548. </table>
  549. </form>
  550. </div>
  551. </body>
  552. </html>

以上是完整代码,其实阅读代码也是一种学习PHP的有效方法。

版权归 马富天PHP博客 所有

本文标题:《PHP探针【转载】》

本文链接地址:http://www.mafutian.net/365.html

转载请务必注明出处,小生将不胜感激,谢谢! 喜欢本文或觉得本文对您有帮助,请分享给您的朋友 ^_^

0

0

上一篇《 在 apache 服务器服务器上使用 ServerAlias 对虚拟主机绑定多个域名 》 下一篇《 linux 下设置 apache 服务器的伪静态 》

所有评论

  1. 首页
  2. 上一页
  3. 1
  4. 下一页
  5. 尾页
  6. 第1页
  7. 每页12条
  8. 共1页
  9. 共1条
评论审核未开启
表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情 表情
验证码

TOP10

  • 浏览最多
  • 评论最多