forked from shangril/crero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_album_to_cart.php
45 lines (29 loc) · 996 Bytes
/
add_album_to_cart.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
session_start();
if (!isset($_SESSION['cart'])) {
$_SESSION['cart']=array();
$_SESSION['cart']['album']=array();
$_SESSION['cart']['track']=array();
}
$albumtoadd=array();
$album_title=$_GET['album'];
if (!isset($_SESSION['album_tracklisting'][$_GET['album']])){
die ('Sorry, the system encoutered an error. Please try to refresh this page and try again. ');
}
$tracklist=$_SESSION['album_tracklisting'][$_GET['album']];
$albumtoadd['title']=$album_title;
$albumtoadd['tracklist']=$tracklist;
array_push($_SESSION['cart']['album'], $albumtoadd);
?>
<div style="text-align:center;">
<h2>Album added to cart</h2>
<strong>The album was added to your download cart</strong>
<br/>
What would you want to do now ?
<h2><a href="javascript:void(0);" onclick="document.getElementById('ajax_splash').style.display='none';">Continue picking songs</a></h2>
or
<h2><a href="view_cart.php" >Process to download</a></h2>
</div>
<?php
die();
?>