Filling selection boxes from INI file
<p>The code:</p>

<pre><code>$INIFile = parse_ini_file('config.ini');
echo '&lt;center&gt;&lt;form method="POST" action=""&gt;&lt;br /&gt;&lt;table class="specialtable"&gt;';
echo '&lt;tr&gt;&lt;td&gt;&lt;font face="Verdana" color="white"&gt;Status:&amp;nbsp;&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;select name="Status"&gt;
&lt;option value="0"&gt;Offline&lt;/option&gt;
&lt;option value="1"&gt;Online&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;';
</code></pre>

<p>The .ini file:</p>

<pre><code>Status = 1
</code></pre>

<p>This is the code I have. How can I make it so the first option will be read from the the .ini file?</p>

<p>Thanks in advance.</p>

<p>This is an example of what needs to be done, except that it does not work. Serves as an example:</p>

<pre><code>echo '&lt;center&gt;&lt;form method="POST" action=""&gt;&lt;br /&gt;&lt;table class="specialtable"&gt;';
echo '&lt;tr&gt;&lt;td&gt;&lt;font face="Verdana" color="white"&gt;Status:&amp;nbsp;&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;select name="Status"&gt;
switch('.$INIFile["Status"].')
{
case 0: &lt;option value="0"&gt;Off&lt;/option&gt;; break;
case 1: &lt;option value="1"&gt;On&lt;/option&gt;; break;
}
&lt;option value="0"&gt;Offline&lt;/option&gt;
&lt;option value="1"&gt;Online&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;';
</code></pre>
