Skip to content

Commit

Permalink
Add form
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpetros committed Jul 18, 2024
1 parent ccb9ad2 commit 53b306b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
24 changes: 22 additions & 2 deletions www/switch-emoji/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,36 @@
padding: 1em;
width: 100vw;
}

body > header {
padding: 0;
border: none;
}

label {
display: block;
margin: 2rem 0;
}

textarea {
display: block;
}
</style>

<!-- <header><a href="/">We Make Internet</a></header> -->
<h1>Switch Emoji Proposal</h1>

We're proposing a new emoji!

<p><a href="/switch-emoji/proposal">View the proposal</a></p>
<p><a href="https://docs.google.com/document/d/16VF-qg8W9c65X8ziQT3gPyOe9b8qe791HUTUFllIHbU">View the google docs version</a></p>

<p>Submitter: Morris Kolman & Alex Petros</p>

Date: Jul 17, 2024
<h2>Tell us how you would use it:</h2>

<form action="/switch-emoji/user.php">
<label>Give us some sequences<textarea name=sequences></textarea></label>
<label>Anything else?<textarea name=info></textarea></label>
<button>Submit</button>
</form>

28 changes: 28 additions & 0 deletions www/switch-emoji/success.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<title>Success!</title>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/vendor/missing.css@1.0.9.min.css">

<style>
body {
margin: 0;
padding: 1em;
width: 100vw;
}
</style>

<!-- <header><a href="/">We Make Internet</a></header> -->
<h1>Success!</h1>

<p><a href="/switch-emoji">Head back to the proposal page</a></p>

<h2>Or send in another one ?</h2>

<form action="/switch-emoji/user.php">
<label>Give us some sequences<textarea name=sequences></textarea></label>
<label>Anything else?<textarea name=info></textarea></label>
<button>Submit</button>
</form>

16 changes: 16 additions & 0 deletions www/switch-emoji/user.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

if ($req['method'] == 'POST'):
[
'sequences' => $sequences,
'info' => $info
] = $_POST;

$issue_date = new DateTime($issue_date_str);

file_put_contents('submissions.txt', $txt.PHP_EOL, FILE_APPEND | LOCK_EX);

header("Location: /switch-emoji/success");
http_response_code(303);

?>

0 comments on commit 53b306b

Please sign in to comment.