Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 0
  1. <?php
  2. @header("content-Type: text/html; charset=utf-8");
  3. error_reporting(E_ALL);
  4. //set_time_limit(10);
  5. define("YES","<span style=\"color: #008000;font-weight : bold;\">Yes</span>");
  6. define("NO","<span style=\"color: #ff0000;font-weight : bold;\">No</span>");
  7. $act=isset($_GET['act'])?$_GET['act']:"";
  8. if($act=="phpinfo"){phpinfo();exit();}
  9. ?>
  10. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  11. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  12. <html xmlns="http://www.w3.org/1999/xhtml">
  13. <head>
  14. <title>PHPnow works!</title>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  16. <meta name="author" content="YinzCN" />
  17. <meta name="reply-to" content="YinzCN@Gmail.com" />
  18. <meta name="copyright" content="YinzCN" />
  19. <style type="text/css">
  20. <!--
  21. body {
  22. font-family : verdana, tahoma;
  23. font-size : 12px;
  24. margin-top : 10px;
  25. }
  26.  
  27. form {
  28. margin : 0;
  29. }
  30.  
  31. table {
  32. border-collapse : collapse;
  33. }
  34.  
  35. .info tr td {
  36. border : 1px solid #000000;
  37. padding : 3px 10px 3px 10px ;
  38. }
  39.  
  40. .info th {
  41. border : 1px solid #000000;
  42. font-weight : bold;
  43. height : 16px;
  44. padding : 3px 10px 3px 10px;
  45. background-color : #9acd32;
  46. }
  47.  
  48. input {
  49. border : 1px solid #000000;
  50. background-color : #fafafa;
  51. }
  52.  
  53. a {
  54. text-decoration : none;
  55. color : #000000;
  56. }
  57.  
  58. a:hover {
  59. text-decoration : underline;
  60. }
  61.  
  62. a.arrow {
  63. font-family : webdings, sans-serif;
  64. font-size : 10px;
  65. }
  66.  
  67. a.arrow:hover {
  68. color : #ff0000;
  69. text-decoration : none;
  70. }
  71. -->
  72. </style>
  73. </head>
  74. <body>
  75. <div style="margin-left: auto;margin-right: auto;width: 600px;">
  76.  
  77. <script type="text/JavaScript">
  78. function get_ip() {
  79. document.getElementById("getipButton").disabled = true;
  80. document.getElementById("ip").innerHTML = '请稍后 ...';
  81. window.location = ('?act=getip');
  82. }
  83. </script>
  84.  
  85. <div style="width: 100px; float: right; padding: 4px;text-align: center;">
  86. <input type="button" value="获取外网 IP" onclick="get_ip();" id="getipButton" />
  87. <span id="ip">
  88. <?php
  89. if($act=='getip'){
  90. $ip=get_ip();
  91. $tmp=$_SERVER['SERVER_PORT'];
  92. $tmp=$tmp==80?"":":".$tmp;
  93. if($ip)echo '此服务器外网 IP<br /><a href="http://'.$ip.$tmp.'">'.$ip.'</a>';
  94. else echo '<br />获取失败';
  95. }
  96. ?>
  97. </span>
  98.  
  99. </div>
  100.  
  101. <table style="text-align: center;">
  102. <tr><td>
  103. <span style="font-weight: bold;font-size: 2.2em;">
  104. <a href="<?=$_SERVER['PHP_SELF']?>?" style="text-decoration: none;">
  105. <?php
  106. $c=array("87cefa","ffa500","ff6347","9acd32","32cd32","ee82ee");
  107.  
  108. $s=ucfirst($_SERVER['SERVER_NAME']);
  109. $a=explode(".",$s);
  110. if($a[0]=="Www"||$a[0]=="Bbs"){
  111. $a[1]=ucwords($a[1]);
  112. $a[0]=strtolower($a[0]);
  113. }
  114.  
  115. $ran = rand(0, count($c));
  116. $s=implode(".",$a);
  117.  
  118. $s=preg_replace("/([a-zA-Z]+|[0-9]+)/","<span style=\"color: #".$c[rand(0, count($c))%count($c)]."\">\$1</span>",$s,1);
  119.  
  120. //rand(0, count($c))
  121. for($i=1;$i<=24;$i++)$s=preg_replace("/>([a-zA-Z]+|[0-9]+|\.|-)([^<]*$)/","><span style=\"color: #".$c[($i+$ran)%count($c)].";\">\$1</span>$2",$s,1);
  122. echo $s;
  123. ?>
  124. </a><br />
  125. </span>
  126. + Powered by PHPnow 1.4 +
  127. </td>
  128. </tr>
  129. </table>
  130.  
  131. <br />
  132.  
  133. <table width="100%" class="info">
  134.  
  135. <tr>
  136. <th colspan="2">Server Information</th>
  137. </tr>
  138.  
  139. <tr>
  140. <td>主机名 (IP:端口)</td>
  141. <td><?=$_SERVER['SERVER_NAME']?> (<?=$_SERVER['SERVER_ADDR'].":".$_SERVER['SERVER_PORT']?>)</td>
  142. </tr>
  143.  
  144. <tr>
  145. <td>服务器软件</td>
  146. <td><?=$_SERVER['SERVER_SOFTWARE']?></td>
  147. </tr>
  148.  
  149. <tr>
  150. <td>PHP 运行方式</td>
  151. <td><?=PHP_SAPI?></td>
  152. </tr>
  153.  
  154. <tr>
  155. <td>网站主目录</td>
  156. <td><?=$_SERVER["DOCUMENT_ROOT"]?></td>
  157. </tr>
  158.  
  159. <tr>
  160. <td>服务器时间</td>
  161. <td><?=gmdate("Y-m-d H:i:s", time()+8*60*60)?> <span style="color: #999999;">(+08:00)</span></td>
  162. </tr>
  163.  
  164. <tr>
  165. <td>Other Links</td>
  166. <td>
  167. <a href='<?=$_SERVER['PHP_SELF']?>?act=phpinfo'>phpinfo()</a>
  168. | <?=file_exists('phpMyAdmin')?"<a href='/phpMyAdmin'>phpMyAdmin</a>":"<a href='http://phpnow.org'>PHPnow.org</a>"?>
  169. </td>
  170. </tr>
  171. </table>
  172.  
  173. <hr />
  174.  
  175. <table width="100%" class="info">
  176. <tr>
  177. <th colspan="2">PHP 组件支持</th>
  178. </tr>
  179.  
  180. <tr>
  181. <td>Zend Optimizer</td>
  182. <td><?=defined("OPTIMIZER_VERSION")?YES." / ".OPTIMIZER_VERSION:NO?></td>
  183. </tr>
  184.  
  185. <tr>
  186. <td>MySQL 支持</td>
  187. <td><?=function_exists("mysql_close")?YES." / client lib version ".mysql_get_client_info():NO?></td>
  188. </tr>
  189.  
  190. <tr>
  191. <td>GD library</td>
  192. <td><?=function_exists("gd_info")?YES." / ".get_gd_info("GD Version"):NO?></td>
  193. </tr>
  194.  
  195. <tr>
  196. <td>eAccelerator</td>
  197. <td><?=function_exists('eaccelerator_info')?YES." / ".get_ea_info("version"):NO?></td>
  198. </tr>
  199. </table>
  200.  
  201. <hr />
  202.  
  203. <form method="post" action="<?=$_SERVER['PHP_SELF']?>">
  204. <table width="100%" class="info">
  205. <tr>
  206. <th colspan="4">MySQL 连接测试</th>
  207. </tr>
  208.  
  209. <tr>
  210. <td>MySQL 服务器</td>
  211. <td><input type="text" name="mysqlHost" value="localhost" /></td>
  212. <td>MySQL 数据库名</td>
  213. <td><input type="text" name="mysqlDb" value="test" /></td>
  214. </tr>
  215.  
  216. <tr>
  217. <td>MySQL 用户名</td>
  218. <td><input type="text" name="mysqlUser" value="root" /></td>
  219. <td>MySQL 用户密码</td>
  220. <td><input type="text" name="mysqlPassword" /></td>
  221. </tr>
  222.  
  223. <tr>
  224. <td colspan="4" align="right"><input type="submit" value="连接" name="act" /> &nbsp;</td>
  225. </tr>
  226. </table>
  227. </form>
  228.  
  229. <?php if(isset($_POST['act'])) {?>
  230. <br />
  231.  
  232. <table width="100%" class="info">
  233. <tr>
  234. <th colspan="4">MySQL 测试结果</th>
  235. </tr>
  236.  
  237. <?php
  238. $link=@mysql_connect($_POST['mysqlHost'],$_POST['mysqlUser'],$_POST['mysqlPassword']);
  239. $errno=mysql_errno();
  240. if($link)$str1='<span style="color: #008000;">连接正常</span> ('.mysql_get_server_info($link).')';
  241. else $str1='<span style="color: #ff0000;">连接失败</span><br />'.mysql_error();
  242. ?>
  243. <tr>
  244. <td colspan="2">服务器 <?=$_POST['mysqlHost']?></td>
  245. <td colspan="2"><?=$str1?></td>
  246. </tr>
  247.  
  248. <tr>
  249. <td colspan="2">数据库 <?=$_POST['mysqlDb']?></td>
  250. <td colspan="2"><?=(@mysql_select_db($_POST['mysqlDb'],$link))?"<span style=\"color: #008000\">连接正常</span>":"<span style=\"color: #ff0000;\">连接失败</span>"?></td>
  251. </tr>
  252. </table>
  253. <?}?>
  254. <hr />
  255.  
  256. <p style="text-align: right;margin: 0;"><a href="http://validator.w3.org/check?uri=referer" style="color: #999999;">Valid XHTML 1.0 Strict</a> / <a href="http://wiki.w3china.org/wiki/index.php/Copyleft" style="color: #008000;"><b>Copyleft</b></a> ! 2007 - ? <a href="http://phpnow.org">PHPnow.org</a></p>
  257.  
  258. </div>
  259. </body>
  260. </html>
  261. <?php
  262. function get_ea_info($name){$ea_info=eaccelerator_info();return $ea_info[$name];}
  263. function get_gd_info($name){$gd_info=gd_info();return $gd_info[$name];}
  264. function get_ip(){
  265. $c=@file_get_contents('http://phpnow.org/myip.php');
  266. //$c = file_get_contents('http://ip.changeip.com:8245');
  267. //$c = substr($c, 0, strpos($c, 13));
  268. return $c;
  269. }
  270. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement