Advertisement
Guest User

Untitled

a guest
May 29th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.85 KB | None | 0 0
  1. <?php
  2. if(isset($_COOKIE['users_resolution'])) {
  3. $screen_res = $_COOKIE['users_resolution'];
  4. }
  5. ?>
  6.  
  7. <html>
  8. <head>
  9. <title>Simple Login</title>
  10.  
  11.  <script>
  12. <!--
  13. writeCookie();
  14. function writeCookie()
  15. {
  16. var today = new Date();
  17. var the_date = new Date("December 31, 2023");
  18. var the_cookie_date = the_date.toGMTString();
  19. var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
  20. var the_cookie = the_cookie + ";expires=" + the_cookie_date;
  21. document.cookie=the_cookie;
  22. }
  23. //-->
  24. </script>
  25.  
  26. </head>
  27. <body>
  28. <!--This part of the script is a short form that prompts the user to enter their account details. the correct user and password is
  29. stored in the checkid page which is username: "sonny" and password: "123"-->
  30. <table>
  31.   <form name="login" action="checkid.php" method="post" onSubmit="return Validate()">
  32.     <input type="hidden" value="agentlogin" />
  33.    
  34.       Username  <input name="username" type="text" id="txtUsername" maxlength="30" />
  35.       <br />
  36.       Password  <input name="password" type="password" id="txtPassword" maxlength="8" />
  37.       <br />
  38.       <input type="submit" name="Submit" value="Login" />
  39.   </form>
  40. </table>
  41.  
  42.  
  43. <center> <strong>
  44. <?php
  45. // These are the web statistics that display the screen resolution, web browser and number of hits.
  46.  
  47. //Displays the resolution
  48. echo $screen_res;
  49. echo "<br />";
  50.  
  51. //Displays the web browser
  52. echo $_SERVER["HTTP_USER_AGENT"];
  53.  
  54. echo "<br />";
  55.  
  56. /* This is the hit counter which counts each time the website is visited. It uses the fopen function and updates the file "hits.txt"
  57. and uses the increment operator to count every visit.*/
  58. $count = file_get_contents("hits.txt");
  59. $count++;
  60. $file = fopen("hits.txt", "w");
  61. fwrite($file, $count);
  62. fclose($file);
  63. //This prints the amount of hits the website has received.
  64. echo $count . " Page Hits."
  65. ?>
  66. </center></strong>
  67.  
  68. </body>
  69. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement