Advertisement
scrand

Cookies Warning Front

Feb 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.14 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4.  
  5. <html>
  6. <head>
  7.     <style>
  8.     .cookies {
  9.         opacity:0.8;
  10.         position: fixed;
  11.         bottom: 0;
  12.         left: 0px;
  13.         width: 100%;
  14.         background-color: #24578e;
  15.         padding:10px;
  16.         font-size:12px;
  17.         text-align:center;
  18.         color:#fff;
  19.     }
  20.     .cookies.off{visibility:hidden;}
  21.     .cookies input{float:right;margin-right:20px;width:auto;}
  22.     </style>
  23. </head>
  24. <body>
  25. <p>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br>some<br>very<br>long<br>text<br></p>
  26. <script>
  27. function CookieClose(){
  28.     var x = document.getElementById("CookieWarning");
  29.     x.className += " off";
  30.     var xhttp;
  31.     xhttp = new XMLHttpRequest();
  32.     xhttp.open("GET", "/helpers/set_cookies_off.php", true);
  33.     xhttp.send();
  34. }
  35. </script>
  36.  
  37. <?php if(!isset($_SESSION['cookie'])){#hide if already closed! ?>
  38.     <div class="cookies" id="CookieWarning">
  39.             Cookies warning text!  <input type="button" value="Close" onclick="CookieClose()">
  40.     </div>
  41. <?php } ?> 
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement