Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP form processing
    text
    copied!<p>I have a html form which has 2 textbox and a text area. I am fetching the data from the form using a php code to display it on another page.</p> <p>html form code:</p> <pre><code> &lt;html&gt; &lt;form name="addsg" method="POST" action="validate.php"&gt; &lt;div class="label"&gt;name&lt;/div&gt; &lt;div class="response"&gt;&lt;span&gt;&lt;textarea class="textarea" name="name"&gt;&lt;/textarea&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="label"&gt;age&lt;/div&gt; &lt;div class="response"&gt;&lt;span&gt;&lt;input class="textbox" name="age" type="text" size="5" maxlength="5" value="" /&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="label"&gt;place&lt;/div&gt; &lt;div class="response"&gt;&lt;span&gt;&lt;input class="textbox" name="place" type="text" value="" /&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="submit_section button"&gt; &lt;input id="generate" type="submit" name="script" value="generate" /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/html&gt; </code></pre> <p>PHP code:</p> <pre><code>&lt;?php if (!empty($_POST['name']) &amp;&amp; !empty($_POST['age']) &amp;&amp; !empty($_POST['place'])) { echo '&lt;textarea name="textarea" id="textarea" cols="100" rows="5" readonly&gt;'; echo "{$_POST['name']},{$_POST['age']} years old, from {$_POST['place']}"; echo '&lt;/textarea&gt;'; } ?&gt; </code></pre> <p>If I put only one name in name text area column, I will get output like this</p> <pre><code>anoop,26 years old, from IN </code></pre> <p>But if I put more than one name in the name column(with same age and place), output showing like this</p> <pre><code>anoop Tom,26 years old, from IN </code></pre> <p>Age and place are showing only for one name, not for all. I would like to get output like this</p> <pre><code> anoop,26 years old, from IN Tom,26 years old, from IN </code></pre> <p>any suggestions ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload