writing to an array into a php file
Posted: Wed Dec 28, 2011 12:44 pm
So i did a game servers listing script and have a file servers.php with 2 arrays in it
I would like a script to insert data into that arrays in the file servers.php and save it. I know that there is the fwrite() but don't know if it writes to a php file. I already did the form.
Code: Select all
$servers = array('1' => 'ip','2' => 'ip','3' => 'ip',);
$ports = array('1' => 'port','2' => 'port','3' => 'port',);Code: Select all
<form method="post" enctype="multipart/form-data">
<table>
<tr>
<td align="center"><label>IP</label></td>
<td align="center"><label>Port</label></td>
<td></td>
</tr>
<tr>
<td><input type="text" name ="IP"></td>
<td><input type="text" name="Port"></td>
<td><input type="submit" name ="Add"value="Add"></td>
</tr>
</table>
</form>