Charity costs added
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
session_start();
|
||||
$a = rand(2, 12);
|
||||
$b = rand(2, 12);
|
||||
$_SESSION['captcha_answer'] = $a + $b;
|
||||
$captcha_q = "$a + $b";
|
||||
if (empty($_SESSION['csrf_token'])) {
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
}
|
||||
|
||||
$a = rand(10, 20);
|
||||
$b = rand(10, 20);
|
||||
$op = ['+', '-', '*', '/'][array_rand(['+', '-', '*', '/'])];
|
||||
if ($op == '+') $_SESSION['captcha_answer'] = $a + $b;
|
||||
elseif ($op == '-') $_SESSION['captcha_answer'] = abs($a - $b);
|
||||
elseif ($op == '*') $_SESSION['captcha_answer'] = $a * $b;
|
||||
else $_SESSION['captcha_answer'] = round($a / $b, 2);
|
||||
|
||||
$captcha_q = htmlspecialchars("$a $op $b");
|
||||
$form_sent = isset($_GET['sent']) && $_GET['sent'] === '1';
|
||||
$form_error = isset($_GET['error']) && $_GET['error'] === '1';
|
||||
$csrf_valid = (isset($_POST['csrf_token']) && ($_POST['csrf_token'] === $_SESSION['csrf_token']));
|
||||
|
||||
$form_error = isset($_GET['error']) ? $_GET['error'] : '';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -27,7 +38,7 @@ $form_error = isset($_GET['error']) && $_GET['error'] === '1';
|
||||
<header class="site-header" id="site-header">
|
||||
<nav class="nav-container">
|
||||
<a href="#hero" class="nav-logo">
|
||||
<span class="logo-icon"><img style="width:32px;" src="img/tinyicon.png"></span>
|
||||
<span class="logo-icon"><img src="img/tinyicon.png" class="logo-icon-img"></span>
|
||||
<span class="logo-text">Fraxle<span class="logo-dot">.net</span></span>
|
||||
</a>
|
||||
<ul class="nav-links" id="nav-links">
|
||||
@@ -64,8 +75,8 @@ $form_error = isset($_GET['error']) && $_GET['error'] === '1';
|
||||
</div>
|
||||
<p class="hero-subtitle">Friendly website design, online apps, tech support and creative wizardry - with a touch of enchantment. Based in Oxfordshire.</p>
|
||||
<div class="hero-actions">
|
||||
<a href="mailto:wizard@fraxle.net" class="btn btn-primary">
|
||||
<i class="fas fa-envelope"></i> wizard@fraxle.net
|
||||
<a href="#" class="btn btn-primary js-email" data-user="wizard" data-domain="fraxle.net" rel="nofollow">
|
||||
<i class="fas fa-envelope"></i> <span class="js-email" data-user="wizard" data-domain="fraxle.net">Contact us</span>
|
||||
</a>
|
||||
<a href="#services" class="btn btn-ghost">
|
||||
Explore the magic <i class="fas fa-arrow-down"></i>
|
||||
@@ -147,7 +158,7 @@ $form_error = isset($_GET['error']) && $_GET['error'] === '1';
|
||||
<div class="about-grid">
|
||||
<div class="about-image reveal">
|
||||
<div class="about-img-placeholder">
|
||||
<img src="img/wizfixer.webp" alt="Danny the tech-wizard" class="mascot-img">
|
||||
<img src="img/wizfixer.webp" alt="Danny the tech-wizard" class="mascot-img">
|
||||
<!-- <i class="fas fa-hat-wizard"></i> -->
|
||||
</div>
|
||||
<div class="about-badge">
|
||||
@@ -292,7 +303,7 @@ $form_error = isset($_GET['error']) && $_GET['error'] === '1';
|
||||
<ul class="contact-details">
|
||||
<li>
|
||||
<i class="fas fa-envelope"></i>
|
||||
<a href="mailto:wizard@fraxle.net">wizard@fraxle.net</a>
|
||||
<a href="#" class="js-email" data-user="wizard" data-domain="fraxle.net" rel="nofollow">Contact us</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fas fa-location-dot"></i>
|
||||
@@ -311,10 +322,19 @@ $form_error = isset($_GET['error']) && $_GET['error'] === '1';
|
||||
<?php if ($form_error): ?>
|
||||
<div class="form-error-msg">
|
||||
<i class="fas fa-triangle-exclamation"></i>
|
||||
<?php if ($form_error === 'mail'): ?>
|
||||
<p>Your message couldn't be delivered - the mail server didn't accept it. Please email me directly at <span class="js-email" data-user="wizard" data-domain="fraxle.net">Contact us</span>.</p>
|
||||
<?php else: ?>
|
||||
<p>Something went wrong - please check your details (including the maths answer) and try again.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form class="contact-form" action="send.php" method="POST" novalidate>
|
||||
<form class="contact-form" action="/send" method="POST" novalidate>
|
||||
<div class="form-group" style="display:none !important;" aria-hidden="true">
|
||||
<label for="website">Website</label>
|
||||
<input type="text" id="website" name="website" placeholder="" autocomplete="off">
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="name">Your Name</label>
|
||||
|
||||
Reference in New Issue
Block a user