Form submission doesn't work - PHP
<p>I'm working on a form validation and I'm currently doing some debugging on my code. I'll insert the necessary code snippets below:</p>

<p>Form code:</p>

<pre><code>echo '&lt;h1&gt; Seismic Recording &lt;/h1&gt;
&lt;div&gt;
&lt;form action="validate2.php" method="POST"&gt;';

echo "Latitude: &lt;input type='text' name='latitude'&gt;";
echo "Longitude: &lt;input type='text' name='longitude'required&gt;";
echo 'Wave Type: &lt;select id="wave_type" name="wave_type" required&gt;
        &lt;option selected value="s"&gt;S&lt;/option&gt;
        &lt;option value="p"&gt;P&lt;/option&gt;
        &lt;option value="surface_wave"&gt;Surface Wave&lt;/option&gt;
        &lt;/select&gt;';
echo "Wave Value: &lt;input type='text' name='wave_value' required&gt;";
echo 'Upload CSV File: &lt;input type="file" name="file"&gt;';
echo " &lt;input type='submit' name='submit' value='submit'&gt;";
echo "&lt;/form&gt;
&lt;/div&gt; ";
</code></pre>

<p>Validation code:</p>

<pre><code>echo "w";

if (isset($_POST['submit'])) {
    echo "t";
    $latitude = $_POST['latitude'];
    if ($latitude  == NULL) {
        echo "Please insert a latitude . &lt;br&gt;";
        $error = $error + 1;
    }
}

echo "q";
</code></pre>

<p>The form validations that I've put within the if statement doesn't work. I tried debugging the code by inserting the 'echo "q"' and  'echo "w"' to see where the problem lies. Those statements work (they output the characters). But the  'echo "t"' within the if statement doesn't work. Why is that so?</p>

<p>Result of var_dump($_POST):</p>

<blockquote>
  <p>array(5) { ["latitude"]=> string(0) "" ["longitude"]=> string(1) "g"
  ["wave_type"]=> string(1) "s" ["wave_value"]=> string(1) "g"
  ["file"]=> string(0) "" }</p>
</blockquote>

<p>My issue isn't so much in getting the latitude to validate but why doesn't the 'echo t' work?</p>