Advertisement
somdcomputerguy

dmsr.php

Mar 25th, 2025 (edited)
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.78 KB | Source Code | 0 0
  1. <!DOCTYPE html>
  2. <html><head>
  3. <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
  4. <meta http-equiv='Content-Language' content='EN'>
  5. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
  6. <title>DMS</title>
  7. <style>
  8. body {
  9.   font-size: 1.3em;
  10.   font-size-adjust: from-font;
  11.   font-variant: small-caps;
  12.   color: orange;
  13.   background: radial-gradient(rgb(0, 0, 0) 25%, rgb(0, 0, 35));
  14. }
  15.  
  16. button {
  17.   margin: 1px;
  18.   margin-bottom: 16px;
  19.   padding: 3px 5px;
  20.   font-size: 12px;
  21.   border-radius: 3px;
  22. }
  23. </style></head><body>
  24. <center><br><br><div id='dateTime'></div>
  25. <script src='dtscript.js'></script>
  26. <?
  27. date_default_timezone_set('America/New_York');
  28.  
  29. $Today     = getdate(); $CurrentTS = mktime($Today['hours'],$Today['minutes'],0,$Today['mon'],$Today['mday'],$Today['year']);
  30. $AddlTime  = '+25 hours 1 minute'; $DMSTime   = date("U", strtotime($AddlTime, $CurrentTS));
  31. $FinalFile = 'dmsr.txt'; if(!file_exists($FinalFile)) { file_put_contents($FinalFile, $CurrentTS); }
  32. $DateStr   = "l\, F j\<\s\u\p\>\<\s\m\a\l\l\>S\<\/\s\m\a\l\l\>\<\/\s\u\p\> Y g\:i A";
  33. $FinalCont = file_get_contents($FinalFile); $FinalContStr = date($DateStr, $FinalCont);
  34.  
  35. if(isset($_GET['update'])) { update(); }
  36.  
  37. echo "<br>". ltrim($AddlTime, '+') ." added to $FinalContStr<br><br>Update by ". date ($DateStr, strtotime($AddlTime, $FinalCont)). "<br><br><button onclick=window.location.replace('?update')>Update</button><br><br>";
  38.  
  39. if($DMSTime < $CurrentTS){ echo "<br><br><strong>It's time for something!</strong>"; unlink($FinalFile); }
  40.  
  41. function update(){
  42. Global $Today, $CurrentTS, $FinalFile; file_put_contents($FinalFile, $CurrentTS); echo "<script>window.location.href = 'dmsr.php'</script>";
  43. }
  44.  
  45. ?></center></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement