Note that there are some explanatory texts on larger screens.

plurals
  1. POphp sending form data between files
    primarykey
    data
    text
    <p>I am new to php and form development and here's what I am trying to achieve:</p> <p>Firstly i have a simple form to input just two text values:</p> <pre><code>Form1 &lt;br&gt; &lt;form action="gather.php" method="post"&gt; Catalog: &lt;input type="text" name="folderName" maxlength="50"&gt; &lt;br&gt; File Name: &lt;input type="text" name="fileName" maxlength="50"&gt; &lt;br&gt; &lt;input type="submit" name="formSubmit" value="Submit"&gt; &lt;/form&gt; </code></pre> <p>And now I have the second file called gather.php where i get theese two lines and use them to count files inside catalog etc.</p> <pre><code>&lt;?php if(isset($_POST['formSubmit'])){ $folderName = $_POST['folderName']; $fileName = $_POST['fileName']; $numberOfImages = count(glob($folderName . "/*.jpg")); for($i = 1; $i &lt;= $numberOfImages; $i++){ echo "&lt;br&gt;&lt;input type=\"text\" name=\"imie" . $i . "\"&gt;&lt;br/&gt;\n"; echo "&lt;img src=\"" . $folderName . "/0" . $i . ".jpg\" height=\"50px\" width=\"50px\"&gt;&lt;br&gt;&lt;br&gt;\n"; } echo "\n&lt;br&gt;" . $folderName . "&lt;br&gt;" . $fileName . "\n"; } ?&gt; &lt;br&gt; Final form &lt;br&gt; &lt;form action="build.php" method="post"&gt; &lt;input type="submit" name="finalSubmit" value="Submit"&gt; &lt;/form&gt; </code></pre> <p>And this should get me to build.php file which looks more less like this:</p> <pre><code>&lt;?php if(isset($_POST['finalSubmit'])){ //loop and other stuff $temp = $_POST['imie1']; echo $temp; } ?&gt; </code></pre> <p>So the thing is that in this final file I'd like to get all the data that was put into text fields in the gather.php file. But I get the undefined index error on build.php saying there's nothing in the $_POST['imie1']. Can you tell me why is that? Is tehre a way to get this data from second file to the third file? </p> <p>Edit: thx for the answers, as I can accept only 1 and multiple are the same I choose the user with least rep just to support her :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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