Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP input value pass to loop
    text
    copied!<p>I am new in PHP and i came across following problem. I want to write a simple form which takes multiple input fields and pass them other page to print those value in multiple lines for example see following screen shot. My question is i want to use loop so i don't need to write all variable name and multiple line.. how do i use loop to achieve following solution?</p> <p><img src="https://i.stack.imgur.com/tljl0.png" alt="enter image description here"></p> <p>This is the output of after submit..</p> <p><img src="https://i.stack.imgur.com/KlLER.png" alt="enter image description here"></p> <p>Here is the code of index.php</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;form action="welcome.php" method="post"&gt; Build File: &lt;input type="text" name="1bname"&gt; WAR File: &lt;input type="text" name="1wname"&gt; Study: &lt;input type="text" name="1study"&gt; Bug: &lt;input type="text" name="1bug"&gt; &lt;br&gt; Build File: &lt;input type="text" name="2bname"&gt; WAR File: &lt;input type="text" name="2wname"&gt; Study: &lt;input type="text" name="2study"&gt; Bug: &lt;input type="text" name="2bug"&gt; &lt;input type="submit"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here is the welcome.php</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;pre&gt;{ ignore(FAILURE) { build( "Deploy", BUILDFILE: "&lt;?php echo $_POST["1bname"]; ?&gt;", WARFILE: "&lt;?php echo $_POST["2wname"]; ?&gt;", STUDY: "&lt;?php echo $_POST["1study"]; ?&gt;", BUG: "&lt;?php echo $_POST["1bug"]; ?&gt;" )}}, &lt;pre&gt;{ ignore(FAILURE) { build( "Deploy", BUILDFILE: "&lt;?php echo $_POST["2bname"]; ?&gt;", WARFILE: "&lt;?php echo $_POST["2wname"]; ?&gt;", STUDY: "&lt;?php echo $_POST["2study"]; ?&gt;", BUG: "&lt;?php echo $_POST["2bug"]; ?&gt;" )}}, &lt;/body&gt; &lt;/html&gt; </code></pre>
 

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