Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
$labels = array(
"What’s on your mind?",
"Hey Joe, what do you know?",
"Speak your brains",
"Share what you know",
"Status report",
"What’s new?"
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<h1><label for="note"><?php echo $labels[array_rand($labels)]; ?></label></h1>
<textarea cols="40" rows="3" id="note" name="note" maxlength="140"><?php
if (isset($_POST['note'])) {
echo htmlspecialchars($_POST['note']);
<br />
<input type="file" name="photo" accept="image/*" />
<input type="hidden" name="latitude" id="latitude" value="" />
<input type="hidden" name="longitude" id="longitude" value="" />
<input type="submit" value="Post" />
<br />
(function (win, doc) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (pos) {
doc.getElementById('latitude').value = pos.coords.latitude;
doc.getElementById('longitude').value = pos.coords.longitude;
}(this, this.document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment