title: No Javascript Fallback for AJAX Form submission
body: <p>I am new to AJAX and am in the process of converting some regular HTML forms to AJAX.</p>
  
  <p>My existing implementation is as follows - form (on page1.php) posts to page2.php which does some validation on post data and redirects to an error page if something is missing. If the input is fine, it includes page3.php which processes the request and redirects back to page1.php.</p>
  
  <p>php/page1.php</p>
  
  <pre><code>&lt;form method="post" action="/php/page2.php" &gt;
     &lt;input type="text" name="input1" placeholder="Howdy..." /&gt;
     &lt;input type="text" name="input2" placeholder="Howdy..." /&gt;
  
     &lt;input type="submit" value="Submit" /&gt;      
  &lt;/form&gt;
  </code></pre>
  
  <p>php/page2.php</p>
  
  <pre><code>&lt;?php
  
    // perform some validation on inputs
    if (empty($_POST['input1']))
    {
       $location ='Location: /php/error.php';
       header($location);
       exit;
    }
  
    // Inputs are fine
    include('/php/page3.php');
  
  ?&gt;
  </code></pre>
  
  <p>page3.php</p>
  
  <pre><code>&lt;?php
  
    // do some form processing
  
  
    // redirect back to page1.php
    $location = 'Location: /php/page1.php";
    header($location);
    exit;
  ?&gt;
  </code></pre>
  
  <p>To convert to AJAX, I am using @SSL's solution on this SO link <a href="https://stackoverflow.com/questions/19813830/how-to-show-loading-gif-when-request-goes-ajax">How to show loading gif when request goes Ajax</a>
  <a href="http://jsfiddle.net/clickthelink/Uwcuz/1/" rel="nofollow noreferrer">http://jsfiddle.net/clickthelink/Uwcuz/1/</a></p>
  
  <p>The error from validation and success page are both displayed back on page1.php via the callback function. </p>
  
  <p>php/page2.php</p>
  
  <pre><code>&lt;?php
  
    // perform some validation on inputs
    if (empty($_POST['input1']))
    {
       // Echo erorr code isntead of redirect
       echo "Please enter input1";
       return;
  
       //$location ='Location: /php/error.php';
       //header($location);
       //exit;
    }
  
    // Inputs are fine
    include('/php/page3.php');
  
  ?&gt;
  </code></pre>
  
  <p>page3.php</p>
  
  <pre><code>&lt;?php
  
    // do some form processing
  
    // Echo success instead of redirect
    echo "SUCCESS";
  
    // redirect back to page1.php
    //$location = 'Location: /php/page1.php";
    //header($location);
    //exit;
  ?&gt;
  </code></pre>
  
  <p>This part is working fine.</p>
  
  <p>My question (finally) is how do I handle users who have javascript disabled? I know the form will get submitted appropriately but I wont get the redirect back in case of the error or success. I would like to retain header() redirect type of functionality in this case also. Is this possible? I would appreciate the help.</p>