I need PHP code to do the following:
1. Read a .conf file (where ";" starts comments, sections are bracketed, and parameter values are set using "name = value" format) and display it in a web form that can be edited.
2. Take the edited values and write them to a file specified in a field on the form from 1 above.
3. Allow the user to download the new file, but also keep a copy on the server.
See below for more details and sample info.
## Deliverables
Sample file ([login to view URL]) contents are:
; settings sample
[general]
; server network settings
server_ip = "[login to view URL]"
subnet_mask = "[login to view URL]"
;filename for server log
log_file_path = "/mnt/abc/[login to view URL]"
; Below are settings related to email
[smtp]
; enable smpt logging to a file
smtp_log_to_file = 1
PHP 1 would build an html form based on a template .conf file that resides on the server with the php files. The form would be divided into sections with labels and fields :
<h2>General</h2>
<table>
<tr><td>SERVER IP<td><input type="text" value="[login to view URL]" name="server_ip">
<tr><td>SUBNET MASK<td><input type="text" value="[login to view URL]" name="subnet_mask">
<tr><td>LOG FILE PATH<td><input type="text" value="/mnt/abc/[login to view URL]" name="log_file_path">
<h2>SMTP</h2>
<tr><td>SMTP LOG TO FILE<td><input type="text" value="1" name="smtp_log_to_file">
<h2>File</h2>
Enter Filename: <input type="text" name="filename" value="[login to view URL]">
<input type="button" onclick="[login to view URL]" value="Generate File">
When submitted, the form would generate a new .conf file , named based on the fielname in the "filename" input field. The user could download that file and the file should reside on teh server.
Thanks