Jump to content

problem with getting form variable.


adam291086

Recommended Posts

Ok i am using this free rte and i have the following code

 

<?php
function freeRTE_Preload($content) {
// Strip newline characters.
$content = str_replace(chr(10), " ", $content);
$content = str_replace(chr(13), " ", $content);
// Replace single quotes.
$content = str_replace(chr(145), chr(39), $content);
$content = str_replace(chr(146), chr(39), $content);
// Return the result.
return $content;
}

?>
<form method="get" action="">
<!-- Include the Free Rich Text Editor Runtime -->
<script src="../js/richtext.js" type="text/javascript" language="javascript"></script>
<!-- Include the Free Rich Text Editor Variables Page -->
<script src="../js/config.js" type="text/javascript" language="javascript"></script>
<!-- Initialise the editor -->
<?php
if(isset($_GET['freeRTE_content']))
{
$content = $_GET['freeRTE_content'];
echo $content;
}
else
{
// Send the preloaded content to the function.
$content = freeRTE_Preload("<i>This is some <b><br>preloaded</b> content</i>")

?>
<script>
initRTE('<?= $content ?>');
</script>
<input type="submit" name="submit">
</form>
<?php
}
?>

 

When i click submit the rte content appears in the URL like so

 

but the RTE is displayed and not the content and i dont know why

 

Link to comment
https://forums.phpfreaks.com/topic/123608-problem-with-getting-form-variable/
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.