Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2. if (isset($_GET['currency']))
  3.     {
  4.         if ($_GET['currency'] == 'USD') {
  5.         $currency = $_GET['currency'];
  6.         $time = time()+31536000;
  7.         setcookie ("currency", $currency , $time);
  8.         }
  9.         else if ($_GET['currency'] == 'EUR') {
  10.         $currency = $_GET['currency'];
  11.         $time = time()+31536000;
  12.         setcookie ("currency", $currency , $time);
  13.         }
  14.         else if ($_GET['currency'] == 'GBP') {
  15.         $currency = $_GET['currency'];
  16.         $time = time()+31536000;
  17.         setcookie ("currency", $currency , $time);
  18.         }
  19.         else {
  20.         $currency = 'GBP';
  21.         $time = time()+31536000;
  22.         setcookie ("currency", $currency , $time);
  23.         }
  24.     }
  25. else if (isset($_COOKIE['currency']))
  26.     {    
  27.         $currency = ($_COOKIE["currency"]);
  28.         }
  29. else
  30.         $currency = 'GBP';
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement