Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
php saves and image manager

New User

Dec 7, 2004, 1:09 PM

Views: 81593
php saves and image manager

i'm looking for 2 things. one is a php save function. i have html area in a protected file, with the content in another folder. i need to be able to save from the editor to the other folder (i don;t think should be a problem)

i'm also looking for a php image manager. i have see the one at zhuo and it's not what i'm looking for. i'm after one like the asp image manager a few posts below. that one's great but my site isn;t asp.

cheers, hinch


Feb 18, 2005, 9:18 AM

Views: 80698
Re: [hinchy] php saves and image manager

As far as the PHP save function goes, heres what I did:

If your file is already created, and your permissions are correct, create a save button that submits it to the next page. On that page, put this code in:

$write = fopen("../filepath/filename.php", "w+"); //Open file for writing 
$fwrite = fwrite($write, stripslashes($ta));//Strip slashes from TextArea and write to file
if($fwrite) // If it worked
{echo "It worked.";}
else // If it didn't work.
{echo "It didn't work.";}
fclose($write); //Close opened file.

Note: the variable '$ta' is the textarea you used for the editor.

If you need to create the file first, be sure to use the 'touch()' function and 'chmod()' to set correct file permissions.