Jump to content

[SOLVED] Rich text editor help


adam291086

Recommended Posts

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("'", "&#39;", $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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.