Advertisement
Guest User

Untitled

a guest
Jun 1st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. <?
  2. session_start();
  3. session_register("user");
  4. ?>
  5. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  9. <title>Login</title>
  10. </head>
  11. <body bgcolor="#666" style="color:#FFF">
  12. <?php
  13. require "Functions.php";
  14. $user=@$_REQUEST['user'];
  15. if($user!=null)
  16. {
  17. $pass=$_REQUEST['pass'];
  18. //有帳號唷
  19. //攻擊驗證
  20. if(!preg_match('/^[A-Za-z0-9]+$/',$user) || !preg_match('/^[A-Za-z0-9]+$/',$pass))
  21. {
  22. //有攻擊!!
  23. $url=$GLOBALS['Msg']['AttackAlert'];
  24. echo "<script>alert('$url');</script>";
  25. }else
  26. {
  27. //驗證登入
  28. if(VertifyAccount($user,$pass))
  29. {
  30. $_SESSION['user']=$user;
  31. //登入了唷
  32. echo "<script>window.location='index.php';</script>";
  33. }else
  34. {
  35. $url=$GLOBALS['Msg']['LoginError'];
  36. echo "<script>alert('$url');</script>";
  37. }
  38. }
  39. }
  40. ?>
  41. <form name="RegisterForm" action="Login.php" method="POST">
  42. <input type="hidden" name="Method" value="create"/>
  43. <table style="background:#333; color:#FFF; border: 1px solid;">
  44. <tr>
  45. <td colspan="2"><h1>AtomixECO Login</h1></td>
  46. </tr>
  47. <tr>
  48. <td>
  49. UserID:
  50. </td>
  51. <td>
  52. <input type="text" name="user" value=""/>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td>
  57. Password:
  58. </td>
  59. <td>
  60. <input type="password" name="pass" value=""/>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td>
  65.  
  66. </td>
  67. <td align="right">
  68. <input type="submit" value="Login">
  69. </td>
  70. </tr>
  71. </table>
  72. </form>
  73. </body>
  74. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement