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

SNMP编程

开发平台:

C/C++

  1. <html>
  2. <script>
  3. <!--
  4. function setfocus() { document.login.form_password.focus(); }
  5. -->
  6. </script>
  7. <head>
  8. <meta http-equiv="Content-Language" content="en-us">
  9. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  10. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  11. <meta name="ProgId" content="FrontPage.Editor.Document">
  12. <title>MRTG Admin login</title>
  13. </head>
  14. <body onLoad=setfocus()>
  15. <p><b><u>MRTG Admin login</u></b></p>
  16. <FORM name=login ACTION=login.php METHOD=POST>
  17.   <table border="0" width="100%">
  18.     <tr>
  19.       <td width="12%">Admin Password:</td>
  20.       <td width="88%"><input type="password" name="form_password" size="20" tabindex="1"></td>
  21.     </tr>
  22.   </table>
  23.   <p><input type="submit" value="Login" name="B1" tabindex="2"></p>
  24. </form>
  25. </body></html>
  26. <?php  
  27. // Replace this path with the path to the config.inc.php file
  28. include ("e:\mrtg\conf\config.inc.php");
  29. if ($pass_wrong == "1"){
  30. echo "Wrong password !!!<br>";
  31. }
  32. if($REQUEST_METHOD == "POST"){ 
  33. if($form_password){  
  34.   if($form_password == $admin_password1 or $form_password == $admin_password2){  
  35.      ?>  
  36.       <script language="JavaScript">  
  37.       location="./admin.php";  
  38.       </script>  
  39.      <?php
  40.   }else{  
  41.       ?>  
  42.       <script language="JavaScript">  
  43.       location="./login.php?pass_wrong=1";  
  44.       </script>  
  45.       <?php  
  46.   }  
  47. }  
  48. }
  49. ?>