kfir91 Posted May 12, 2009 Share Posted May 12, 2009 hello everyone i am just a new member on this forum, and also i am newbie in web programing, so maybe sometimes i`ll disturb you with some questions, and there the firs one. so i have a little form.php file which has three fields 1. date 2. title 3. news after submiting all the data contained in this fields is sent to update.php file which itself connects to MySQL DB and iserts data into table. everything works fine. and now i decided to add "RICH TEXT EDITOR" to third Filed Named "news" . in previouse form for the third field i had something like this: Code: <textarea name="news" type="text" cols="20" rows="20"></textarea> after i had to change this field and insert javascirpt code which displays textarea with rich text editting buttons up above it. and in this case everything goes fine too. but i have little problem with POSTING data from that third field with RTE on it. simply the text contained in this field is not sent to database, so when i want to print out content of DB Date and title is displayed only. but full text which must appear too shows just an empty page. please help, maybe i miss something in the code. here is the code of a form.php file: Code: <html> <head> <title>RTE</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link rel="stylesheet" type="text/css" href="styles/styles.css" /> <script language="JavaScript" type="text/javascript" src="richtext.js"></script> </head> <body topmargin=20 leftmargin=20 bgcolor="#CCCCCC"> <form name="myform" onsubmit="return submitForm();" action="update.php" method="post"> <br> insert date <input name="date" type="text"> <br> insert title <input name="title" type="text"> <br> full text <br> <br> <script language="JavaScript" type="text/javascript"> <!-- function submitForm() { updateRTE('rte1'); //updateRTEs(); alert("Submitted value: "+document.myform.rte1.value) return true; } //Usage: initRTE(imagesPath, includesPath, cssFile) initRTE("images/", "", ""); //--> </script> <script language="JavaScript" type="text/javascript"> <!-- //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly) writeRichText('rte1', 'insert text here', 400, 200, true, false); //--> </script> <br><Br> <input type="submit" value="submit"> </form> </body> </html> Thanks a lot ! Link to comment https://forums.phpfreaks.com/topic/157890-i-have-some-problem-rte-text-editor-and-php-page-tnx/ Share on other sites More sharing options...
neogemima Posted May 12, 2009 Share Posted May 12, 2009 It doesn't look like the rich text editor has any name defined to it in the form for the POST function to connect with your php page. try echoing the variable where the news is contained in your php page. If it's blank, you know your page is not being passed a value from the text editor. I'd start there. Link to comment https://forums.phpfreaks.com/topic/157890-i-have-some-problem-rte-text-editor-and-php-page-tnx/#findComment-832840 Share on other sites More sharing options...
kfir91 Posted May 13, 2009 Author Share Posted May 13, 2009 writeRichText('rte1', 'insert text here', 400, 200, true, false); its the code that doing the rich text editor... so now i send the form and the $_POST['rte1'] blank in the php page... what the problem ... ? Link to comment https://forums.phpfreaks.com/topic/157890-i-have-some-problem-rte-text-editor-and-php-page-tnx/#findComment-833060 Share on other sites More sharing options...
neogemima Posted May 13, 2009 Share Posted May 13, 2009 I'm sorry, but I couldn't quite understand your last post, are you saying the variable $_POST['rte1'] IS blank on your php page? If it is, I would look at your Rich Text Editor's code that it's pulling from, or look at a tutorial from the website where you downloaded it. Another possible solution: Are you using addslashes or htmlentities in your php form to prepare the contents for the database? Check out this thread:http://www.dynamicdrive.com/forums/showthread.php?t=14368 A lot of times, there are requirements when transferring the data to php, you may be missing a step. Link to comment https://forums.phpfreaks.com/topic/157890-i-have-some-problem-rte-text-editor-and-php-page-tnx/#findComment-833421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.