title: What validation is important in a PHP web form that only interacts with itself?
body: <p>I made a simple base64 decoder form, which takes in an input through a textarea.  I assume the input is base64 encoded.  If it isn't base64 input, and there's a PHP error or garbage is returned, I don't mind at the moment  However, from a security perspective do I need to do any validation or sanitation on this input?</p>
  
  <p>The page is called error-decoder.php, and it submits to itself, and doesn't interact with a database or anything else.  Here is the whole thing:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="container" style="width: 80%; margin: 0 auto; font-family: sans-serif;"&gt;
  
              &lt;form name="error-decoder" action="error-decoder.php" method="post"&gt;
                  &lt;textarea name="error-text-area" style="width: 100%; height: 400px;"&gt;
                      &lt;?php if(!empty($_POST['error-text-area'])){ echo $_POST['error-text-area']; } ?&gt;
                  &lt;/textarea&gt;
                  &lt;button type="submit" style="float: right;"&gt;Decode&lt;/button&gt;
              &lt;/form&gt;
  
              &lt;?php
              if(!empty($_POST['error-text-area'])){
              ?&gt;
                  &lt;p&gt;Output:&lt;/p&gt;
                  &lt;hr&gt;
                  &lt;div id="error-output"&gt;
                  &lt;br /&gt;
              &lt;?php
                  echo base64_decode($_POST['error-text-area']) . "&lt;/div&gt;";
              }
              ?&gt;
  
          &lt;/div&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Is there anything that needs to be done to make this safe either for the user or for my server?  Are there important php.ini settings I need to worry about that would affect your answer?  I don't care about errors or garbage except how it might affect security.  Thanks for any info on this!</p>