title: Saving info while submitting page with GET in PHP
body: <pre><code>&lt;form method='get' action='y.php'&gt;
     &lt;div&gt;
       &lt;input type='text' id='txtName'  name='txtName'/&gt;
       &lt;input type='submit' value='submit' id='submit'/&gt;
     &lt;/div&gt;
   &lt;/form&gt;
   &lt;?php
     if ($_SERVER['REQUEST_METHOD'] == 'GET') 
     {
        if (isset($_GET['btnSave'])) {
            $name=isset(($_GET['txtName'])?isset($_GET['txtName']:'');
        //then Logic of insert goes here
        }
    }
  ?&gt;
  </code></pre>
  
  <p>so before moving to <code>y.php</code> the record must be saved.
  but I cant get the <code>$name</code> value, as action given to <code>y.php</code>.
  How can I get <code>$name</code> which contain value in text box.</p>
  
  <p>if you change the action to this (same/current) page record is going to database without any flaw or error.</p>