Valhalla Legends Archive

Programming => Web Development => Topic started by: j0k3r on February 16, 2004, 04:14 PM

Title: [PHP] Text Editor
Post by: j0k3r on February 16, 2004, 04:14 PM
Alright I just got another job from a guy I've done some stuff with before. This time he has asked me to develope a text editor(similar to the "new mail" one in hotmail) so that he(or his customers) can change how a page looks without having to open it up in notepad and edit through HTML code.

I personally can't see how this can be done using PHP, he said he's seen it done with javascript, so I'd figure it is possible, but like I said I don't see how it can be done. Can somebody enlighten me as to how this could potentially be done?
Title: Re:[PHP] Text Editor
Post by: j0k3r on February 16, 2004, 04:16 PM
Oh yeah he IS paying me for this so I'd be willing to work with someone and give them a cut. I am not asking someone to do this for me, I like learning PHP, but this isn't something I think I'll be able to do alone and might need some guidance on.
Title: Re:[PHP] Text Editor
Post by: j0k3r on February 17, 2004, 07:20 AM
Er, the e-mail I check is [email protected], e-mail me if interested, or my AIM is j0k3rKZ.
Title: Re:[PHP] Text Editor
Post by: Forged on February 17, 2004, 06:30 PM
I know I have seen a tutorial on how to do that somewhere but I am not sure where.  try http://www.phpfreaks.com/ I think they probally have it, and if not you can definatlly get help in their forums.
Title: Re:[PHP] Text Editor
Post by: FLiPPY_ on February 18, 2004, 07:48 PM
http://www.phpforums.com
Really good forums for PHP
Title: Re:[PHP] Text Editor
Post by: iago on February 18, 2004, 08:18 PM
I did something exactly like that in JSP, if that will help.  It's technically proprietary code, but I can show it to you if you want a reference, just don't use it :P

<Edit> it lets them load a text file off the server (verifies it's not binary) that's under some constant length (100kb, I think) and edit it, then save.  It also has some Javascript buttons that add html tags.  Will that help?
Title: Re:[PHP] Text Editor
Post by: j0k3r on February 18, 2004, 08:55 PM
NOOOOOOOOOOOOOOOOO dumbass back button, gotta retype my post.

iago, yes that would probably help some. My problem lies mostly in that PHP is a scripting language, and once the script is executed nothing else can be done to it (no interactivity really). To do this you would have to reload the page every time a change is made, which isn't very efficient... Also clicking the bold button wouldn't work because as I said, once it's executed there's nothing else that PHP can do (PHP get's output'd as 100% HTML, and only the final result is displayed).

Somebody please correct me? I'd be glad to be wrong in this case.
Title: Re:[PHP] Text Editor
Post by: iago on February 18, 2004, 09:11 PM
Yes, you're right.  JSP and any other scripting is the same way.

The way I do it is with a <textarea> containing the page, and a "Save" button at the bottom.  
Title: Re:[PHP] Text Editor
Post by: j0k3r on February 19, 2004, 06:32 AM
Quote from: iago on February 18, 2004, 09:11 PM
Yes, you're right.  JSP and any other scripting is the same way.

The way I do it is with a <textarea> containing the page, and a "Save" button at the bottom.  
Oooops, didn't read your post thoroughly I thought you said in Java... Yeah for sure it will help then, you know where to find me.
Title: Re:[PHP] Text Editor
Post by: iago on February 19, 2004, 08:29 AM
It would be possible to do it in Java, with an applet, but difficult
Title: Re:[PHP] Text Editor
Post by: j0k3r on February 20, 2004, 04:03 PM
Well this is dead... new thread.

http://forum.valhallalegends.com/phpbbs/index.php?board=34;action=display;threadid=5382;start=0#lastPost