General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 31st, 2002, 05:24 AM
gpullman gpullman is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 1 gpullman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question saving content to a file

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.

Reply With Quote
  #2  
Old July 31st, 2002, 08:39 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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

Reply With Quote
  #3  
Old August 8th, 2002, 01:38 AM
Gaby Gaby is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 5 Gaby User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried this code as well and can't get anything but ...SetValue($myData); ?> ... as the outcome.

Reply With Quote
  #4  
Old August 8th, 2002, 07:31 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > saving content to a file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT