remove.php
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:2k
源码类别:

SNMP编程

开发平台:

C/C++

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  4. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  5. <meta name="ProgId" content="FrontPage.Editor.Document">
  6. <title>MRTG remove switch:</title>
  7. </head>
  8. <body>
  9. <p><b><u>MRTG remove switch:</u></b></p>
  10. <FORM ACTION=remove.php METHOD=POST>
  11.   <table border="0" width="100%">
  12.     <tr>
  13.       <td width="12%">Switch:</td>
  14.       <td width="88%"><select size="1" name="switch">
  15. <?
  16. // Include config file with path variable, etc...
  17. include ("c:\mrtg\conf\config.inc.php");
  18. $dir = dir($mrtg_config_dir);
  19. // echo "<ul>";
  20. while($filename=$dir->read()) {
  21. if (eregi(".(cfg)$",$filename))
  22. echo "<option value=".substr($filename, 0, -4).">".substr($filename, 0, -4)."</option>";
  23. }
  24. $dir->close();
  25. //echo "</ul>";
  26. ?>
  27.        </select></td>
  28.     </tr>
  29.     <tr>
  30.       <td width="12%">Option:</td>
  31.       <td width="88%"><input type="checkbox" name="del_config" value="ON">Delete
  32.         config file</td>
  33.     </tr>
  34.     <tr>
  35.       <td width="12%"></td>
  36.       <td width="88%"><input type="checkbox" name="del_html" value="ON">Delete
  37.         stats</td>
  38.     </tr>
  39.     <tr>
  40.       <td width="12%"></td>
  41.       <td width="88%"><input type="checkbox" name="del_index" value="ON">Delete
  42.         html index</td>
  43.     </tr>
  44.   </table>
  45.   <input type="submit" value="Delete" name="B1"><input type="reset" value="Reset" name="B2">
  46. </form>
  47. <hr>
  48. </body>
  49. </html>
  50. <?
  51. // Include config file with path variable, etc...
  52. include ("e:\mrtg\conf\config.inc.php");
  53. if($REQUEST_METHOD == "POST"){ 
  54. if (file_exists($mrtg_config_dir.$switch.".cfg") && $del_config == "ON") { 
  55. echo " $switch config files removed...<br>";
  56. unlink($mrtg_config_dir.$switch.".cfg"); 
  57. unlink($mrtg_config_dir.$switch.".ok");
  58. }
  59. if (file_exists($mrtg_html_dir.$switch) && $del_html == "ON") { 
  60. echo " $switch html files removed...<br>";
  61. exec( "rmdir /s /q ".$mrtg_html_dir.$switch); 
  62. }
  63. if (file_exists($mrtg_html_dir.$switch.".html") && $del_index == "ON") { 
  64. echo " $switch index files removed...<br>";
  65. unlink($mrtg_html_dir.$switch.".html"); 
  66. }
  67. }
  68. echo "<br><a href=./>Back to index</a>";
  69. ?>