title: Writing and editing a PHP config file from a HTML form?
body: <p>Hi just looking for some direction, I have a HTML form which has several fields and basically what I am wanting to do is save the data entered from the form to a PHP config file and also have the ability to edit the saved data by accessing and submitting the form again. I would prefer to do this without the use of a database.</p>
  
  <p>So here's an example:</p>
  
  <pre><code>&lt;form method="post" name="config_form"&gt;
  &lt;div id="field"&gt;
  &lt;label&gt;Keywords&lt;/label&gt;
  &lt;br /&gt;
  &lt;input type="text" name="keyword"&gt;
  &lt;/div&gt;
  
  &lt;br /&gt;
  
  &lt;select name="color"&gt;
  &lt;option value="green"&gt;Green&lt;/option&gt;
  &lt;option value="orange"&gt;Orange&lt;/option&gt;
  &lt;option value="blue"&gt;Blue&lt;/option&gt;
  &lt;option value="red"&gt;Red&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>So the user enters 'computer' as the keyword and selects the color 'blue'. I want to then save this data into my config.php file as variables allowing my other website pages to access this data. Should this all be in an array as well?</p>
  
  <pre><code>&lt;?php
  //config file
  $keyword = "computer";
  $color = "blue";
  
  ?&gt;
  </code></pre>
  
  <p>Also when I go back access the form again can I make it so the fields are prefilled with the data from the config.php file?</p>
  
  <p>Any help would be much appreciated thank you!</p>