1

Topic: Here's my web-based HTML Editor

Well, it really pissed me off the fact that i had to open my file on my comp, edit it and then reupload it, now its all solved.
Here's the result:
nukex.x-wh.net/index.php this file is edited through nukex.x-wh.net/editindex.php
if anybody needs the script, just reply here.

.::CrystaLizeD::.

2

Re: Here's my web-based HTML Editor

hi CrystaLizeD,

I just start to develop a web site for friends of mine. They want to be able do update pages that contains text but don't know nothing about HTML/css/... languages ! Though, I think that they would be able to use this TinyMCE interface.
I want to use it the way you describe, so that they don't have to browse their server to upload the modified file (in case they put it in a wrong folder...). Your solution is also a gain of time (save of unuseful clicks) ! You just have to click on the "save" button, and the update is recorded in your file, is that it ?

If that is so, I may be interested by your 2 files. Could you send them to me ?

THANX

3

Re: Here's my web-based HTML Editor

I can't see your site, but the idea sounds good, could I have a copy too ?

thanks!

4

Re: Here's my web-based HTML Editor

Can I get it too?

5

Re: Here's my web-based HTML Editor

ok so due to high demand, here's the script. You need to have 3 files :
index.php (which is blank and CHMOD to 777)
editindex.php (the file that edits index.php - pretty easy to figure it out eh?)
and submit.php (the file that "submits" contents written in editindex.php to index.php)

so the code to have in editindex.php is:

<html>
<head>
<title>Untitled Page</title>
</head>
<body bgcolor="#ffffff">
<form method="post" action="submit.php">
<textarea name="content" cols="85" rows="15">
<?php include('index.php'); ?>
</textarea>
<input type="submit" name="SUBMIT">
</form>
</body>
</html>

submit.php :

<?php
$fp = fopen( "index.php", "w" );

if(!$fp)
{echo "Couldn't open the data file. Try again later.";
exit;}

$content = $_POST['content']; 

fwrite( $fp, $content );
fclose( $fp );
?>

<?php include('index.php'); ?>

enjoy. now all you have to do is integrate it with TinyMCE which is basically just copy-paste lol.

.::CrystaLizeD::.

6

Re: Here's my web-based HTML Editor

thanks for the scripts!
without any php knowledge whatsoever I've managed  to succeed!

7

Re: Here's my web-based HTML Editor

Hi everybody, the name's KROY. I'm quite new abt TinyMCE but I'm trying.

CrystaLizeD, in submit.php what is that

if(!$fp)
{echo "Couldn't open the data file. Try again later.";
exit;}

about?

It always shows me the message, but the files are not missing and I guess index.php in in 777.
I know it's probably something stupid (as usually) but can't get out of this.

Someone?

THX

8

Re: Here's my web-based HTML Editor

Hello again ._.

with this one:

--------------------
<?php
$fp = fopen("index.php", "r", "w");

if(!$fp)
{echo "Couldn't open the data file. Try again later.";
exit;}

$content = $_POST['content'];

fwrite( $fp, $content );
fclose( $fp );
?>

<?php include('index.php'); ?>
--------------------

it DOES work, but gives a blank index.php page even if the textarea is filled.

'till now, THX as well. I'll try, hints are well accepted.

KROY

9

Re: Here's my web-based HTML Editor

Well, it seems only a server-RW-related-trouble. On some kinds I can get the code to work, on others I can't.
It seems solved, however. Thx as well.

10

Re: Here's my web-based HTML Editor

THX a lot, that script works very well.
But I have a problem, and I do not know how to solve it.
The editing of the text works well, in case I try to insert a smily, this is shown online, but not yet saved with the document.

Do You have any hint for me.
Thx in advance

11

Re: Here's my web-based HTML Editor

Me too, herb37.
It cannot save images or anything but plain text.
Don't know... I'll probably work on it on august... SIGH .__.

12

Re: Here's my web-based HTML Editor

I was having issues with the Content_CSS plugin but I got it fixed. Thanks for posting the code, it has really helped out!

Last edited by pipkc (2006-08-07 15:27:41)

13

Re: Here's my web-based HTML Editor

Im haveing the same problem with the smilies and all color and images dose it have to do with a file name content_css? if so where and how do I fix it lol ? cannot save any images .

Last edited by gmdnew guy (2009-07-03 12:23:07)

14

Re: Here's my web-based HTML Editor

how did you fix the image problem? im having same issue!
witch file is causing this problem?

KROY wrote:

Me too, herb37.
It cannot save images or anything but plain text.
Don't know... I'll probably work on it on august... SIGH .__.

15

Re: Here's my web-based HTML Editor

Hi CrystaLizeD.
Thanks for posting the code, it has really helped out!
Just one problem... When i coping and pasting some images from my pages, the tinymce adding code like this ../../img/img.jpg , but i need it like this ./img/img.jpg.
Any ideas about how to fix it?

16

Re: Here's my web-based HTML Editor

Do a server-side replacement to correct the URLs. The URLs are correct from the editor's page but maybe not from where the document will be located. So once again: Do a server-side replacement.

Greetings from Germany,

Felix Riesterer.
-- I am neither Moxiecode nor Ephox! --

17

Re: Here's my web-based HTML Editor

It always shows me http://fifacs.com/ the message, but the files are not missing and I guess index.php in in 777.
I know it's probably something stupid (as usually) but can't get out of this.