You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
4.4 KiB
PHP

<?php
require_once __DIR__ . "/settings.php";
$plan = $_GET['plan'];
if (!isset(PLANS[$plan])) {
header("Location: /#pricing");
die("Invalid plan chosen.");
}
?>
<!DOCTYPE HTML>
<title><?php echo SITE_TITLE; ?></title>
<?php
include __DIR__ . '/inc/meta.php';
include __DIR__ . '/inc/piwik.php';
?>
<!-- Wrapper -->
<div id="wrapper">
<?php include __DIR__ . "/inc/header.php"; ?>
<!-- Section -->
<section id="one" class="main alt">
<header class="accent1">
<h1>Purchase</h1>
</header>
<div class="inner alt">
<div class="content">
<p>Purchase a month of service. If you are a new user, enter a username, password, and email to register with. If you are an existing user, enter your login username and password, check the renewal box, and enter a valid email address.</p>
<?php
$err = "";
switch ($_GET['err']) {
case "renewinvaliduser":
$err = "You have selected the renew option, but the username you gave does not exist.";
break;
case "usernameinvalid":
$err = "That username is not available. Please choose another.";
break;
case "renewpasswrong":
$err = "The password is incorrect.";
break;
case "bademail":
$err = "The email address is not in a valid format. Try again.";
break;
case "shortpassword":
$err = "Your password is too short. It needs to be at least 8 characters long.";
break;
case "commonpassword":
$err = "Your chosen password is in a <a href=\"https://github.com/danielmiessler/SecLists/tree/master/Passwords\">public list</a> of 1,000,000 common passwords, and is therefore insecure. Choose a better one.";
break;
case "acceptterms":
$err = "You need to accept the terms of service.";
break;
case "":
$err = "";
break;
default:
$err = "An unknown error occurred. Try again, and if the issue persists, <a href=\"https://support.netsyms.com/index.php?a=add&category=9\">open a support ticket</a>.";
break;
}
if ($err !== "") {
echo "<div style=\"margin-bottom: 10px;\"><b style=\"color: #a93226;\">$err</b></div>";
}
?>
<form action="purchase2.php" method="POST">
<label for="username">Username:</label>
<input type="text" name="username" id="username" placeholder="Username" required />
<br />
<label for="password">Password:</label>
<input type="password" name="password" id="password" placeholder="Password" required />
<br />
<label for="email">Email:</label>
<input type="email" name="email" id="email" placeholder="dsm@example.com" required />
<br />
<input type="checkbox" name="renewing" id="renewing" value="1" /> <label for="renewing">This is a renewal</label>
<br />
<input type="hidden" name="plan" value="<?php echo $plan; ?>" />
<br />
<input type="checkbox" name="agree_tos" id="agree_tos" value="1" /> <label for="agree_tos">I agree to the <a href="terms.php" target="_BLANK">terms of service (click to read in new tab)</a></label>
<br />
<?php if ($plan != "free" && $clearnet == false) { ?>
Note: The next page needs to load third-party clearnet code from Stripe to process your payment. If you don't want that, email dsm@netsyms.com and mention your preferred methods.
<br />
<?php } ?>
<button type="submit">Next</button>
</form>
</div>
</div>
</section>
<?php include __DIR__ . "/inc/footer.php"; ?>
</div>
<?php include __DIR__ . "/inc/scripts.php"; ?>