Kann sich das mal jmd anschauen?
PHP-Code:
<?
if($_POST['sub']=="eintragen"){
$named_conf_insert = "\n\r\n\rzone \"".$_POST['zone']."\" {\n\r";
$named_conf_insert .= " type ".$zonetype.";\n\r";
$named_conf_insert .= " file \"".$zonetype."/".$_POST['zone']."\";\n\r";
if($_POST['zonetype']=="s"){
$named_conf_insert .= " masters {".$_POST['masterip'].";};\n\r";
}
$named_conf_insert .= "};";
// echo $named_conf_insert;
$nc = "named.conf";
$nc_tmp = "named.conf.tmp";
$nc_handle = fopen($nc, "r");
$old_nc = fread($nc_handle, filesize($nc));
fclose($nc_handle);
$nc_tmp_handle = fopen($nc_tmp, "w");
$new_nc = $old_nc.$named_conf_insert;
$write_tmp_nc = fwrite($nc_tmp_handle,$new_nc);
if($write_tmp_nc != 0 ){
$sys_str = "mv ".$nc_tmp." ".$nc;
system($sys_str,$sys_res)
if($sys_res == 1){
echo "FEHLER - Datei zwar angelegt, konnte aber nicht per system(mv) bewegt werden";
}
else{
echo "Neue Zone erfolgreich in ".$nc." eingepflegt.";
}
}
else{ // Hier soll der Parse error sein...
echo "FEHLER - Speichern der neuen Zone in ".$nc_tmp." fehlgeschlagen!";
}
}
else{
?>
<table align="center" width="300">
<tr>
<td align="center">Neue Zone hinzufügen</td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td align="left">
<form action="neue_zone.php" method="POST" target="">
<table>
<tr>
<td nowrap>Zone: <input type="Text" name="zone" value="" size="36" maxlength=""></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td><input type="Radio" name="zonetype" value="master" checked> Master</td>
</tr>
<tr>
<td><input type="Radio" name="zonetype" value="slave" nowrap> Slave - MasterIP: <input type="Text" name="masterip" value="" size="" maxlength="16"></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td align="center"><input type="Submit" name="sub" value="eintragen"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?
}
?>
Kommentar