<!-- show form on initial load or if there's a problem with a previous post -->
<?php if (strlen($message) > 0 || !isset($_POST['xsubmit'])) { ?>
  <form action="index.php" method="post" enctype="multipart/form-data">
    <input type="hidden" name="xsubmit" value="y"/>
    <input type="hidden" name="pid" value="<? echo $_GET["pid"] ?>"/>
    <input type="file" name="file" id="file" required /> <br />
    <div class="details">File must be GIF, PNG, or JPEG/JPG and 2MB in size or less.</div>
    <input type="email" name="email" id="email" placeholder="you@place.org" required /><label for="location"> Email Address</label><br />
    <input type="text" name="attribution" id="attribution" placeholder="Name or Company" required /><label for="location" title="name, company, etc."> Attribution</label><br />
    <p class="details">
      <strong>The Fine Print</strong><br />
      By submitting this photo, you agree that you own the copyright on the photo—you photographed it yourself, 
      it is a work for hire, or the copyright was transferred to you via written statement 
      or operation of law (e.g., inheritance). You also agreet to allow the photo to be 
      freely copied and modified by anyone, including third parties not affiliated with 
      Mecklenburg County Government, for any purpose.
    </p>
    <input type="checkbox" name="license" id="license" value="license" required /><label for="license"><strong>I agree</strong> with these terms and conditions.</label>
    <br />
    <input type="submit" name="submit" value="Upload" />
    <?php if (strlen($message) > 0) { ?>
      <p class="warning"><? echo $message ?></p>
    <?php } ?>
  </form>

<!-- show thank you message if everything loaded successfully -->
<?php } else { ?>
  <h2>You're Super!</h2>
  <p>You just helped add data all of our citizens can use and enjoy. Thanks!</p>
  <p>Your photo should be available within the next few days. We'll let you know when it's ready.</p>
<?php } ?>