crazy.works Posted July 22, 2008 Share Posted July 22, 2008 hello , well , it is my first time to use fckeditor in my scripts because i still try to make my way on the php programming so about the fckeditor , i downloaded the files from http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.2.zip then i put the fckeditor folder with php file in folder called editor in the php file just a normal simple textarea with the fckeditor codes that i saw on the documentation so here is my code , please help me to find why the editor and the texarea didnt appear in my browser ------------------------------------- <?php include_once("fckeditor/fckeditor.php") ; ?> <html > <head> <title>New Page 1</title> </head> <body> <form method="POST" action="submit.php"> <p> </p> <p> </p> <p><textarea rows="15" name="world" cols="56"></textarea></p> <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> <?php $oFCKeditor = new FCKeditor ("world") ; $oFCKeditor->BasePath = 'fckeditor/' ; $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ; $oFCKeditor->Create() ; ?> </form> </body> </html> ------------------------------------------ and here is othere code that i got by friend on mine and it didnt work too ------------------------- <script type="text/javascript" src="fckeditor/fckeditor.js"></script> <script type="text/javascript" src="fckeditor/fckconfig.js"></script> <html > <head> <title>New Page 1</title> </head> <body> <form method="POST" action="submit.php"> <p> </p> <p> </p> <p><textarea rows="15" name="world" cols="56"></textarea></p> <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> </form> <script type="text/javascript"> var oFCKeditoren = new FCKeditor ( "world"); oFCKeditoren.BasePath = "fckeditor/"; oFCKeditoren.Height = 300 ; oFCKeditoren.ReplaceTextarea(); </script> </body> </html> -------------------------------- please help me to find the error thanks Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 modify your code to say $oFCKeditor->BasePath = 'editor/fckeditor/' ; //if that's right looks like your base path is incorrect. it's relative to where the code calling it is. Quote Link to comment Share on other sites More sharing options...
crazy.works Posted July 22, 2008 Author Share Posted July 22, 2008 no i mean folder called editor in it the fckeditor folder and the php file . so the path is correct Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 You need everything. Just dump the fckeditor (whole folder). The files named: fckconfig.js fckeditor.js fckeditor.php fckeditor_php4.php fckeditor_php5.php need to be there. then you need this folder: <editor> in the folder that contains those files. Without the .js files, it will never work. those are the actual editor and config files. I have a couple projects that have fckeditor, so if you need further help, just ask. Quote Link to comment Share on other sites More sharing options...
crazy.works Posted July 22, 2008 Author Share Posted July 22, 2008 oh ok i think i made all of that , so please i have some thing to ask about just can u upload for me compress file that include the fckeditor with php file in it the normal textarea code that u tested on your localhost , just to try it and to know the error and the problem in my files please ?? Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 I don't have the original code any more. I modified mine to work with my open-source script. I'm glad to work with you with the version that they have (out of box), and explain how to make it work. Quote Link to comment Share on other sites More sharing options...
crazy.works Posted July 22, 2008 Author Share Posted July 22, 2008 oh ok thanks so i have other thing to ask about , i got other editor and it called TinyMCE , u can download it from here http://tinymce.moxiecode.com/download.php so it works very well and i didnt got problem with it like the fckeditor . about my question , if my code will be like that ------------- <html > <head> <title>New Page 1</title> <script type="text/javascript" src="tiny_mce/tiny_mce_gzip.js"></script> <script type="text/javascript"> tinyMCE_GZ.init({ plugins : 'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,'+ 'searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras', themes : 'simple,advanced', languages : 'en', disk_cache : true, debug : false }); </script> <!-- Needs to be seperate script tags! --> <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced" }); </script> </head> <body> <form method="POST" action="submit.php"> <p> </p> <p> </p> <p><textarea rows="15" name="world" cols="56"></textarea></p> <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> </form> </body> </html> --------------------------- and it works good and the editor appear so how will i save the form data on the database and what code will i use to show the data with other php file ? Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 in submit, you will call the posted data from $_POST['world'] you can then sanitize it, and store it in a database, or do any other kind of data manipulation from it. Quote Link to comment Share on other sites More sharing options...
crazy.works Posted July 22, 2008 Author Share Posted July 22, 2008 so when i will save it in field world in the database the all form (words and picz ) will be saved ? Quote Link to comment Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 I'm not sure what you mean. I've got no knowledge regarding TinyMCE. I'm just telling you what the post variable will be, when submitted. Quote Link to comment Share on other sites More sharing options...
crazy.works Posted July 22, 2008 Author Share Posted July 22, 2008 iam saying this because when i made the form as i show u and i made the submit.php file to receive the data and to show it the submit.php file in it that code <? $cool = $_POST['world']; echo $cool; ?> simple and easy , just receive the data from the textarea and showing it but i got problem it show the text that i write with the preference ,font size , color , every thing is ok , but when i add pic with the the form in the textarea it didnt appear on the submit.php file if the image link was on the textarea like http://localhost/1.jpg it appear on the submit.php fie like that http://localhost/2/tinymce/1.jpg%5C%22 so please can u tell me why it being like that ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.