Forum Moderators: coopster

Message Too Old, No Replies

PHP & Javascript

         

web_server

8:54 am on Mar 30, 2006 (gmt 0)



I have a simple form with RTF (rich text formatting) . This RTF is a javascript code and I'm using PHP. How can I get the value of the RTF into a PHP vairaible .
I read about using Get method but I don't know how to use it .
Here is the code :
//////////////////////////////////////
<html>

<body>

<form name="RTEDemo" method="get">
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {

updateRTEs();

return true;
document.writeln('document.RTEDemo.rte1');

}

//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/", "", "");
//-->
</script>

<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', '', 520, 200, true, false);

//-->
</script>

<p>
<input type="submit" name="submit" ></p>

</form>

</body>
</html>
/////////////////////////////////////////////////
any ideas?
thank you .

scriptmasterdel

9:02 am on Mar 30, 2006 (gmt 0)

10+ Year Member



Ever heard of FCK? its a easy yo use and install WYSIWIG editor!

Interested? -> www.fckeditor.net

{*** EDIT ***}

Thinking about it ... have you tried to request the name of the RTF editor?

e.g. $_GET['rte1'];

... TRY THAT!

and then show the results ...

echo $_GET['rte1'];

web_server

3:34 pm on Mar 30, 2006 (gmt 0)



Hi,
Thank you scriptmasterdel.
I used FCKeditor it is cool .
I have simple question why when I click on the submit button it opens page.php in a new window?
I don't want that . I want page.php to open instade of the editor page .
Do you know how to do that?
this is the code :
/***********************************************************
<form action="page.php" method="post" target="_blank">
<?php
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/FCKeditor/' ;// '/FCKeditor/' is the default value.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_s" ) ) ;

$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = $sBasePath ;

if ( isset($_GET['Skin']) )
$oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . $_GET['Skin'] . '/' ;

$oFCKeditor->Value = '' ;
$oFCKeditor->Create() ;
?>
<br><center>
<input type="submit" >
</center></form>
/**********************************************************

scriptmasterdel

8:20 am on Mar 31, 2006 (gmt 0)

10+ Year Member



<form action="page.php" method="post" target="_blank">

Either remove target="_blank" or change it to target="_self"

Del

web_server

4:26 am on Apr 1, 2006 (gmt 0)



Thanks scriptmasterdel
I really appreciate your reply and it works!

scriptmasterdel

8:22 am on Apr 3, 2006 (gmt 0)

10+ Year Member



No Problem, Happy Scripting!

Del