cancel
Showing results for 
Search instead for 
Did you mean: 

PHP DHTML page edit

Simon
Grafter
Posts: 64
Thanks: 3
Registered: ‎01-08-2007

PHP DHTML page edit

Dear All,
I want to give a user the ability to edit one or two pages in a site..
I think something like joomla etc is overkill!
I found a DHTML editor (http://www.unica.edu/uicfreesoft/wysiwyg_web_edit/info_wysiwyg_web_edit_eng.html) which looks fine, though out of date.
I'm having trouble writing the file tho':
this code is in a .php file (chmod 755)..
[tt] $fname = './sample.htm';
// Get handle to file
if (!$handle = fopen($fname, 'w')) {
$amsg = "Cannot open file ";
echo "\n alert(\"".$amsg."\"+fname);";
exit;
}[/tt]
..it fails on fopen.
file_exists works ok.. so prob a rights issue.. even tried chmod 666 sample.htm to no avail.
Does anyone have any thoughts (helpful!)
Cheers,
Simon.
2 REPLIES 2
dougrice
Rising Star
Posts: 218
Thanks: 1
Fixes: 2
Registered: ‎06-08-2007

Re: PHP DHTML page edit

Have you tried chmod on the directory to enable writing so that the script can create new file.
Peter_Vaughan
Community Veteran
Posts: 14,469
Registered: ‎30-07-2007

Re: PHP DHTML page edit

Is this php in your cgi-bin directory? If so it must be moved outside of it.
Also the directory the file is in must be at least chmod 770 to allow writing to and searching (i.e. access) to any files within it.