<?php 
    require_once("config.php");
    if((isset($_POST['Creator'])&& $_POST['Creator'] !='') && (isset($_POST['Sharestring'])&& $_POST['Sharestring'] !=''))
    {

      $Creator = $conn->real_escape_string($_POST['Creator']);
      $ShortLink = $conn->real_escape_string($_POST['Short_Link']);
      $LongLink = $conn->real_escape_string($_POST['Long_Link']);
      $Sharestring = $conn->real_escape_string($_POST['Sharestring']);
       $waLa = $conn->real_escape_string($_POST['WaLa']);
      $mapType = $conn->real_escape_string($_POST['MapType']);

      $sql="INSERT INTO newmaps (Creator, ShortLink, LongLink, Sharestring, wala, mapType) VALUES ('".$Creator."','".$ShortLink."', '".$LongLink."', '".$Sharestring."', '".$waLa."', '".$mapType."')";
        if(!$result = $conn->query($sql)){
            die('There was an error running the query [' . $conn->error . ']');
        }
        else
        {
          echo "Thank you! You can now search for these maps easily by typing in any of the identifiers!";
        }
    }
    else
    {
    echo "Looks like we still need the Creators' name and a Sharestring";
    }
?>