-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresults.php
81 lines (70 loc) · 4.35 KB
/
results.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
date_default_timezone_set("Europe/London");
$now = time();
$birthday = $_GET['date'];
$age_days = floor(($now - $birthday)/(60*60*24));
$start_date_web = strtotime("1989-03-12");
$web_days = floor(($now - $start_date_web)/(60*60*24));
$older_days = floor(($now - $birthday)/(60*60*24));
$younger_age_difference = $web_days - $age_days;
$older_age_difference = $age_days - $web_days;
$result = "";
$sharing_result = "";
if ($age_days < $web_days) {
$result = "The internet was $younger_age_difference days old when you were born!";
$sharing_result = "The internet was $younger_age_difference days old when I was born! Click on the link to find out just how old you were when the internet was launched.";
$days = $younger_age_difference;
} elseif ($age_days > $web_days) {
$result = "The internet was launched $older_age_difference days after you were born!";
$sharing_result = "The internet was launched $older_age_difference days after I was born! Click on the link to find out just how old you were when the internet was launched.";
$days = $older_age_difference;
} else {
$result = "Wow! You're exactly the same age as the internet!";
$sharing_result = "Wow! I'm exactly the same age as the internet! Click on the link to find out just how old you were when the internet was launched.";
$days = 0;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Results</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta property="og:site_name" content="How old is the internet?">
<meta property="og:title" content="How old is the internet?">
<meta name="description" property="og:description" content="<?=$sharing_result?>">
<meta property="og:type" content="website">
<meta property="locale" content="en_GB">
<meta property="og:url" content="https://howoldistheinter.net/results.php?date=<?= $birthday; ?>">
<meta property="og:image" content="https://howoldistheinter.net/image.php?text=<?= $days; ?>">
<link rel="canonical" href="https://howoldistheinter.net/">
<script async defer data-domain="howoldistheinter.net" src="https://plausible.io/js/script.outbound-links.js"></script>
<link rel="me" href="https://masto.ai/@tosbourn">
<link rel="me" href="https://tosbourn.com">
<link rel="me" href="mailto:[email protected]">
<script async src="https://epnt.ebay.com/static/epn-smart-tools.js"></script>
</head>
<body>
<h1><?= $result; ?></h1>
<div class="intro date-box">
<a href="/" class="submit">Try another date!</a>
</div>
<div class="ebay-ad">
<ins class="epn-placement" data-config-id="ffe17ccbb34b8e64b8f903ed"></ins>
</div>
<div class="socialshares">
<h2>Share</h2>
<a class="social facebook" target="_blank" rel="noopener" href="https://www.facebook.com/sharer/sharer.php?u=<?= urlencode("https://howoldistheinter.net/?date={$birthday}")?>"><img src="images/share-facebook.svg" alt="Facebook icon" width="32" height="32"><span>Facebook</span></a>
<a class="social twitter" target="_blank" rel="noopener" href="https://twitter.com/intent/tweet?text=<?= $sharing_result; ?>&url=<?= urlencode("https://howoldistheinter.net/?date={$birthday}")?>"><img src="images/share-twitter.svg" alt="Twitter icon" width="32" height="32"><span>Twitter</span></a>
<a class="social linkedin" target="_blank" rel="noopener" href="https://www.linkedin.com/shareArticle?mini=true&url=<?= urlencode("https://howoldistheinter.net/?date={$birthday}")?>&title=<?=$sharing_result?>&summary=<?=$sharing_result?>&source=<?= urlencode("https://howoldistheinter.net/?date={$birthday}")?>"><img src="images/share-linkedin.svg" alt="LinkedIn icon" width="32" height="32"><span>Linkedin</span></a>
</div>
<script async src="https://cdn.carbonads.com/carbon.js?serve=CKYI523W&placement=howoldistheinternet" id="_carbonads_js"></script>
<footer>
<p class="madeby">
<a href="https://tosbourn.com/"><img class="logo" src="images/logo.png" alt="Tosbourn logo"></a>
Made by <a href="https://tosbourn.com/" rel="author">tosbourn ltd</a>
</small>
</p>
</html>