adam291086 Posted November 22, 2007 Share Posted November 22, 2007 Ok. I have found a free rich text editor for my website. I have played around with the code to get the text within the text box to transfer to another php page. My problem is that the varible is passed with \ \ \. I have set up a page to remove them but nothing happens. The code is below <?php if (!(isset($_POST["rte1"]))) { echo "no variable set"; } else { $tmpString = $_POST["rte1"]; //convert all types of single quotes $tmpString = str_replace(chr(145), chr(39), $tmpString); $tmpString = str_replace(chr(146), chr(39), $tmpString); $tmpString = str_replace("'", "'", $tmpString); //convert all types of double quotes $tmpString = str_replace(chr(147), chr(34), $tmpString); $tmpString = str_replace(chr(148), chr(34), $tmpString); $tmpString = str_replace("\"", "\"", $tmpString); //replace carriage returns & line feeds $tmpString = str_replace(chr(10), " ", $tmpString); $tmpString = str_replace(chr(13), " ", $tmpString); echo $tmpString; } ?> Thanks for any help You can see whats happening here http://www.adamplowman.co.uk/cycling/rte/rte.php Link to comment https://forums.phpfreaks.com/topic/78413-solved-rich-text-editor-help/ Share on other sites More sharing options...
~n[EO]n~ Posted November 22, 2007 Share Posted November 22, 2007 I think addslashes will solve your problem, I had the same issue with text editor $tmpString = addslashes($_POST["rte1"]); Link to comment https://forums.phpfreaks.com/topic/78413-solved-rich-text-editor-help/#findComment-396813 Share on other sites More sharing options...
adam291086 Posted November 22, 2007 Author Share Posted November 22, 2007 thanks for the help but that added more slashes. I want to remove them. My script is set up to do it. I don't know why its adding slashes in the first place. Link to comment https://forums.phpfreaks.com/topic/78413-solved-rich-text-editor-help/#findComment-396814 Share on other sites More sharing options...
adam291086 Posted November 22, 2007 Author Share Posted November 22, 2007 just added $tmpString = stripslashes($_POST["rte1"]); and its worked Thanks for the help neon. You push me in the right direction. Link to comment https://forums.phpfreaks.com/topic/78413-solved-rich-text-editor-help/#findComment-396817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.