-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcurrency.php
More file actions
22 lines (22 loc) · 822 Bytes
/
currency.php
File metadata and controls
22 lines (22 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
session_name('Client_Session');
session_start();
if(isset($_GET['currency'])) {
$currencies = array('USD', 'EUR', 'GBP', 'TND');
if(in_array(strtoupper($_GET['currency']), $currencies)) {
$_SESSION['currency'] = strtoupper($_GET['currency']);
if($_SESSION['currency'] == 'GBP') {
$_SESSION['symbol'] = '£';
} elseif($_SESSION['currency'] == 'EUR') {
$_SESSION['symbol'] = "€";
} elseif($_SESSION['currency'] == 'TND') {
$_SESSION['symbol'] = "DT";
} else {
$_SESSION['symbol'] = "$";
}
header("Location: https://" . $_SERVER['HTTP_HOST'] . urldecode($_GET['url']));
} else {
die('Currency not supported!');
}
} else die('You are not allowed to execute this file directly!');
?>