Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Remove from favorites Remove from favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (1 vote)

0% thumbs up 100% thumbs down

How would you rate this answer?

Thank you for rating this answer.

How can I load the contents of a file, edit it and then save it again?

You can use DevEdit to load a HTML file, edit it and then save it again quite easily.

Here's some PHP code that will load a file called content.html and show its HTML in the DevEdit control. You can then change the content and it will be saved back to the content.html file:



$myDE = new DevEdit;

if(@$_POST["save"] == "true")
$fileContent = $myDE->GetValue(false);
$fp = fopen("content.html", "w");
fputs($fp, $fileContent);
echo "Content.php saved!<br><br><a href='test.php'>Continue</a>";
$fp = fopen("content.html", "rb");
$data .= fgets($fp, 1024);
<form action="test.php" method="post">
<input type="hidden" name="save" value="true">
<?php $myDE->ShowControl(400, 300, "my_image_dir"); ?>

<input type="submit" value="Save">

Note: This is an example. You may have to change parts of the code above to get it to work.

Related Articles

No related articles were found.


No attachments were found.

Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software