Skip to content

Commit

Permalink
Initial files
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex authored and Alex committed Jun 7, 2012
1 parent 1b3b4f4 commit 1202ee5
Show file tree
Hide file tree
Showing 46 changed files with 22,527 additions and 1 deletion.
36 changes: 36 additions & 0 deletions represent-map/add.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
include "header.php";

// This is used to submit new markers for review.
// Markers won't appear on the map until they are approved.

$owner_name = htmlspecialchars($_POST['owner_name']);
$owner_email = htmlspecialchars($_POST['owner_email']);
$title = htmlspecialchars($_POST['title']);
$type = htmlspecialchars($_POST['type']);
$address = htmlspecialchars($_POST['address']);
$uri = htmlspecialchars($_POST['uri']);
$description = htmlspecialchars($_POST['description']);

// validate fields
if(empty($title) || empty($type) || empty($address) || empty($uri) || empty($description) || empty($owner_name) || empty($owner_email)) {
echo "All fields are required - please try again.";
exit;

} else {

// insert into db, wait for approval
$insert = mysql_query("INSERT INTO places (approved, title, type, address, uri, description, owner_name, owner_email) VALUES ('0', '$title', '$type', '$address', '$uri', '$description', '$owner_name', '$owner_email')") or die(mysql_error());

// geocode new submission
$hide_geocode_output = true;
include "geocode.php";

// if we got here, let the user now everything's OK
echo "success";
exit;

}


?>
Loading

0 comments on commit 1202ee5

Please sign in to comment.