Simple PHP editor of text files

前端 未结 8 1523
名媛妹妹
名媛妹妹 2020-12-08 11:04

I have developed a site for a client and he wants to be able to edit a small part of the main page in a backend type of solution. So as a solution, I want to add a very basi

8条回答
  •  暖寄归人
    2020-12-08 11:47

    You create a HTML form to edit the text-file's content. In case it get's submitted, you update the text-file (and redirect to the form again to prevent F5/Refresh warnings):

    Moved.', htmlspecialchars($url));
        exit();
    }
    
    // read the textfile
    $text = file_get_contents($file);
    
    ?>
    
    

提交回复
热议问题