law Posted July 20, 2008 Share Posted July 20, 2008 I am using this great WYSIWYG editor from http://koivi.com/WYSIWYG-Editor/ it does all that I need. However it outputs the edited data like this <?php echo nl2br(htmlentities($_POST['editor1_content'])); ?> How can I take the data and produce a variable? If i try the obvious way <?php $variable= nl2br(htmlentities($_POST['editor1_content'])); ?> It give me a whitespace error? I have no idea what nl2br or htmlentites does to the $_POST however I am sure I need them for the data to be properly transferred to the mysql database. (That is the whole reason behind producing a variable.) **Edit: I looked up in the php manual to see what nl2br and htmlentities were used to accomplish. It is now extremely important to me that their functionality for converting things into html be included in database entry. Is there a way to produce their output assigned to a variable? ** Quote Link to comment https://forums.phpfreaks.com/topic/115665-solved-wysiwyg-editor-out-put-question/ Share on other sites More sharing options...
cooldude832 Posted July 20, 2008 Share Posted July 20, 2008 what??? That is assigning it to a variable in your second method do you know how to use a variable??? Quote Link to comment https://forums.phpfreaks.com/topic/115665-solved-wysiwyg-editor-out-put-question/#findComment-594602 Share on other sites More sharing options...
MadTechie Posted July 20, 2008 Share Posted July 20, 2008 you may have a weird character in your code copy your code into notepad, then copy it from notepad and paste it back in, heres some working code <form method="POST"> <input type="text" name="editor1_content"> <input type="submit" name="submit"> </form> <?php if(isset($_POST['submit'])) { $variable= nl2br(htmlentities($_POST['editor1_content'])); echo $variable; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/115665-solved-wysiwyg-editor-out-put-question/#findComment-594608 Share on other sites More sharing options...
law Posted July 20, 2008 Author Share Posted July 20, 2008 nl2br(htmlentities($_POST['editor1_content'])); I apologize I am too drowsy... I was doing this $variable= "nl2br(htmlentities($_POST['editor1_content']))"; which was giving me the whitespace error.. I noticed it after you guys had recommended that i echo it.. thank you for your time sorry.. I hate being the guy who always makes the stupid mistakes! :-X ** edit: If some one else searches this later take out the quotations just assign the variable like so $variable= nl2br(htmlentities($_POST['editor1_content'])); while painfully obvious.. maybe someone is as dumb as i am and this will help them one day.. lol don't force yourself to code for a deadline.. it just makes you sloppy! ** Quote Link to comment https://forums.phpfreaks.com/topic/115665-solved-wysiwyg-editor-out-put-question/#findComment-594631 Share on other sites More sharing options...
cooldude832 Posted July 20, 2008 Share Posted July 20, 2008 read up on how connotation works in php and you will see that the quotes are your problem. Quote Link to comment https://forums.phpfreaks.com/topic/115665-solved-wysiwyg-editor-out-put-question/#findComment-594632 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.