Einzelnen Beitrag anzeigen
  #3  
Alt 15.12.2007, 01:29:57
Tumasch Tumasch ist offline
Junior Member
 
Registriert seit: Dec 2007
Beiträge: 151
AW: Datei mit PHP Editieren

Weil ich heute mal nett bin ...

PHP-Code:
<?php
$myaction 
$_POST['myaction'];
switch (
$myaction) {

    default :
        
$text file("sc_serv.conf");
        
$post $text[28];
?>
<form method="post" action="me.php" name="sichern">
<input type="hidden" name="myaction" value="save">
<input name="pw" rows="1" cols="20" value ="<?php echo substr($post,9); ?>">
<input type="submit" value="save">
</form>
<?php

        
break;
    case 
'save' :
        
$text file("sc_serv.conf");
        
$text[28] = "Password=".$_POST['pw'];
        
$file fopen("sc_serv.conf","w");
        
fwrite($fileimplode("\n"$text));
        
fclose($file);
        break;
}
?>
PS: Filtern solltest du das ganze aber auch noch.
Mit Zitat antworten