|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am new to this stuff and lack some basic information. I want users to be able to fill in an EditWorks Professional text area and save the content to a file. (I'd like them to be able to open it later for editing).
Mitchell was kind enough to send me this snippet <?php include("class.ewp.php"); $fp = fopen("myfile.html", "rb"); $ewpBox1 = new EWP; while(!feof($fp)) { $myData .= fgets($fp, 1024); } $ewpBox1->SetValue($myData); ?> But I don't understand what to do with it. |
|
#2
|
|||
|
|||
|
If I'm not mistaken, by reading the code, that's what is used for reading the existing file and inputting it into the textarea.
So when a user wants to edit their HTML file, you would use this code to open the file for reading, and have it displayed in the EditWorksPro.PHP textarea.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
I tried this code as well and can't get anything but ...SetValue($myData); ?> ... as the outcome.
|
|
#4
|
|||
|
|||
|
What you do with that piece of code is,
Firstly you need a form with a submit button, something like this <?php include("class.ewp.php"); $myEWP = new EWP; if(@$_POST["show"] == "") { // Show the HTML form ?> <form action= "test.php" method= "post"> <input type= "hidden" name= "show" value="1"> <?php $myEWP->ShowControl(400, 300, "myimagedir"); ?> <input type= "submit" value= "Post It >>"> </form> <?php } ok you have something like this right! that will display the editor then if you want to save it as a file paste this in after it else { $fp = fopen("myfile.html", "rb"); while(!feof($fp)) { $myData .= fgets($fp, 1024); } $ewpBox1->SetValue($myData); } ?> that will save any data to the file myfile.html I hope that helps and sorry for the late reply Regards Ben Rowe |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > saving content to a file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|