how to store variable values over multiple page loads
<p>I'm making a php script that stores 3 arrays: <code>$images</code>, <code>$urls</code>, <code>$titles</code> based on the input data of the form within the php file.</p>

<p>I want to print the values of these arrays in the first part of the page and then to pre-fill the form's input fields with the value of the arrays. Also when a user modifies an input field and clicks on "Save" the page should reload with the modfied version.</p>

<p>My problem is that on each call of the php file in a browser the value of the variables gets deleted. Is there a way to store the values of the array so that the form always gets pre-filled with the last saved values?</p>

<pre><code>&lt;?php
//save the arrays with the form data
$images = array($_POST["i0"],$_POST["i1"],$_POST["i2"],$_POST["i3"]);
$urls = array($_POST["u0"],$_POST["u1"],$_POST["u2"],$_POST["u3"]);
$titles = array($_POST["t0"],$_POST["t1"],$_POST["t2"],$_POST["t3"]);
//print the arrays
print_r($images);
print_r($urls);
print_r($titles);
//create the form and populate it
echo "&lt;p&gt;&lt;form method='post' action='".$_SERVER['PHP_SELF']."';";
$x = 0;
while ($x &lt;= 3) {
   echo"&lt;div&gt;
            &lt;input name='i".$x."' type='text' value='".$images[$x]."'&gt;
            &lt;input name='u".$x."' type='text' value='".$urls[$x]."'&gt;
            &lt;input name='t".$x."' type='text' value='".$titles[$x]."'&gt;";
       $x++;
}
?&gt;
&lt;br&gt;
&lt;input type="submit" name="sumbit" value="Save"&gt;&lt;br&gt;
&lt;/form&gt;
</code></pre>
