Help related to reading values from a form and writing it to a destination file using PHP
<p>Presently working on extracting values out of a form and writing it to a file. </p>

<p>My form has two text fields and a dropdown. 
The dropdown gets its elements from a text file. </p>

<p>A destination file needs to be created everytime a user edits the form. </p>

<p>The form looks like:</p>

<pre><code>&lt;form method="get" action="index.php" name=""&gt;
&lt;input type="text" name="val1" size="" value=""&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="text" name="val2" size="" value=""&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;?php
  $spfile = file("path_of_the_text_file_elements_are_extracted_from");
  echo "&lt;select name='sp' value=''&gt;";
  foreach($spfile as $value) {
    echo "&lt;option value='spval'&gt;$value&lt;/option&gt;";
  }
  echo "&lt;/select&gt;"; 
?&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="submit" name="submit" value="Submit" /&gt;
</code></pre>

<p>Below is the code I was trying to use to create the file when the user edits the form: </p>

<pre><code>&lt;?php   

{
 $dest = "destination_file.txt";
 $file = fopen($dest,'w');

 fwrite($file,"Value1:");
 //$value1=$_GET['val1'];
 //fputs($file,$Value1);
 fwrite($file,"\n");
 fwrite($file,"Value2:");
 fwrite($file,"\n");
 fwrite($file,"Value3:");
 fclose($file);

}
</code></pre>

<p>Having problem at:</p>

<ol>
<li>Reading the values of the edited form and writing the values in the destination file.</li>
<li>Not sure how to use $_GET for the dropdown to read the selected value off of the dropdown list, and to write it to the destination file.</li>
</ol>

<p>The destination file should look like:</p>

<p>Value1:(value read from the form)
Value2:(Value read from the form)
Value3:(Value read from the form)</p>
