title: Passing url parameters in form action attribute
body: <pre><code>&lt;?php for($i = 0; $i &lt; $pin_num_rows; $i++){ ?&gt;
  &lt;form action="/group/&lt;?php echo $group_id ?&gt;?Comment=&lt;?php echo $pin_id[$i] ?&gt;" method="post" id="group-comment-form"&gt;
  &lt;textarea name="group-comment" id="group-comment" placeholder="Add a comment..."  spellcheck="false"&gt;&lt;/textarea&gt;
  &lt;/form&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>This is the some part of my code. As you can see, I am passing the value of pin_id in my form action. The problem is, whenever I post comment, the form submits the value with /group/?Comment=1 but it supposed to submit with 1, when I comment to the first post. So, when I comment to the second post, it supposed pass 2 but it doesn't. It always passes /group/?Comment=1</p>
  
  <p>I did echo this right after my textarea and I see that for every comment form, the number increments as it should be but when I submit, it submits with value 1. I am going crazy.</p>
  
  <pre><code>&lt;?php echo "/group/&lt;?php echo $group_id ?&gt;?Comment=$pin_id[$i]" ?&gt;
  </code></pre>
  
  <p>I have also this part in my code in the same loop above and it has the same logic but it works. I don't understand why the form part doesn't work.</p>
  
  <pre><code>&lt;a href="/group/&lt;?php echo $group_id ?&gt;?Edit=&lt;?php echo $pin_id[$i] ?&gt;" title="Edit" id="group-edit-button"&gt;Edit&lt;/a&gt;
  &lt;a href="/group/&lt;?php echo $group_id ?&gt;?Delete=&lt;?php echo $pin_id[$i] ?&gt;" title="Delete" id="group-delete-button"&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I wrote this simple program which demonstrates the same logic that I used for the site and this simple program works but website. I guess the problem is not about the names of form or textarea.</p>
  
  <pre><code>&lt;?php
  $inputValue = NULL;
  $id = [1,2,3];
  
  if(isset($_POST['inputName'])){
  $inputValue = $_POST['inputName'];
  echo "&lt;br&gt;Input Value: " . $inputValue;
  }
  
  if(isset($_GET['id'])){
  $getValue = $_GET['id'];
  echo "&lt;br&gt;Get Value: " . $getValue;
  }
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;Multiple Forms in One Page&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  
  &lt;br&gt;
  &lt;a href="index.php"&gt;Main Page&lt;/a&gt;
  &lt;br&gt;
  &lt;?php for($i = 0; $i &lt; 3; $i++){ ?&gt;
  &lt;form action="index.php?id=&lt;?php echo $id[$i] ?&gt;" method="post" name="formName"&gt;
          &lt;textarea name="inputName"&gt;&lt;/textarea&gt;
          &lt;input type="submit" name="submitName"&gt;
  &lt;/form&gt;
  &lt;?php } ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>FOUND THE PROBLEM (BUT STILL NEED FIX)</strong></p>
  
  <pre><code>&lt;script&gt;
      $(function() {
          $('textarea#group-comment').on('keydown', function(e) {
              if(e.keyCode == 13 &amp;&amp; !e.shiftKey){
                  document.getElementById('group-comment-form').submit();
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I use this script to submit my forms. I don't have a submit button to submit. If I use submit button, everything works perfect but if I use this script above to submit the form, it won't work. What should I do to make the script above work?</p>
  
  <p><strong>SOLUTION</strong>
  After I found where the problem is caused, I created another question to find a fix for the problem. </p>
  
  <p>The answer is here: <a href="https://stackoverflow.com/questions/29992310/submitting-textarea-when-clicked-enter/29992332#29992332">Solutution</a></p>