lolo
01-14-2007, 06:30 PM
Hi there,
I am trying to change the preload html content, and use the content of a variable instead. When I declare the variable in the page it works :
<?php
$test="<b>hello</b> world";
?>
<script language="JavaScript" type="text/javascript">
<!--
writeRichText('rte1', '<?php echo $test;?>', 520, 400, true, false);
this works fine, the RTE shows : hello world , in the text box
but if my content comes from my MySql data base :
<?php
$sql = "SELECT test FROM test";
$req=mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$data=mysql_fetch_assoc($req);
$test=$data['test']; //this contains "<b>hello</b> world"
?>
<script language="JavaScript" type="text/javascript">
<!--
writeRichText('rte1', '<?php echo $test;?>', 520, 400, true, false);
//-->
</script>
the RTE doesn't even open.
What do I do wrong? Can someone help?
thank you :)
lolo
I am trying to change the preload html content, and use the content of a variable instead. When I declare the variable in the page it works :
<?php
$test="<b>hello</b> world";
?>
<script language="JavaScript" type="text/javascript">
<!--
writeRichText('rte1', '<?php echo $test;?>', 520, 400, true, false);
this works fine, the RTE shows : hello world , in the text box
but if my content comes from my MySql data base :
<?php
$sql = "SELECT test FROM test";
$req=mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$data=mysql_fetch_assoc($req);
$test=$data['test']; //this contains "<b>hello</b> world"
?>
<script language="JavaScript" type="text/javascript">
<!--
writeRichText('rte1', '<?php echo $test;?>', 520, 400, true, false);
//-->
</script>
the RTE doesn't even open.
What do I do wrong? Can someone help?
thank you :)
lolo