summaryrefslogtreecommitdiff
path: root/src/frontend_blog/essay_cc_pay.php
blob: a0bc8ba8550825b7f0d6875abf371473bab90a9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
session_start();
if (!$_SESSION['cc_payment'])
{
  echo "No session active";
  die();
}
$article = $_GET['article'];
$_SESSION['payment_ok'] = true;
if (!isset($_SESSION['allowed_articles']))
  $_SESSION['allowed_articles'] = array ($article => true);
else $_SESSION['allowed_articles'] = array_merge($_SESSION['allowed_articles'], array ($article => true));
http_response_code (301);
// WARNING: the following construct yields non-expected forms when using URL
// parameter in it
//$url = (new http\URL($_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']))
//  ->mod(array ("path" => "essay_fulfillment.php?article=$article"), http\Url::JOIN_PATH);
$url =  'http://' . $_SERVER['HTTP_HOST'] . "/essay_fulfillment.php?article=$article";
header("Location: " . $url);
echo $url;
die();
?>