I can't get value form FCK editor using multi fileds form. There are many fields in my form and they are posted to php file. When I use the sampleposteddata.php from "_samples" I get all of variables in one(array). I'd like to get the text from FCKeditor in one variable for example:
$get_FCK_text=$_POST["this_is_FCK_text"];
Thanks for help
$get_FCK_text=$_POST["this_is_FCK_text"];
Thanks for help
RE: Getting value from FCK editor for PHP
RE: Getting value from FCK editor for PHP
RE: Getting value from FCK editor for PHP
my example (using sample01.php):
<form action="samplepostdata.php" method="post">
<input type="text" name="company">
When I post data to -samplepostadata.php I'll get all of fileds of my form in one.
$postArray = &$_POST ;
foreach ( $postArray as $sForm => $value )
{$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
?>
<?=$sForm?>
<?=$postedValue?>
But I'd like to get variables separetly for example:
&company=&_POST["company"];
&text_from_FCK==&_POST["text_from_FCK"];
RE: Getting value from FCK editor for PHP
RE: Getting value from FCK editor for PHP
I figured out how to do it. After looking at the source for a while i devised a way to get it to work.
To get it to work, you have to set your FCKeditor's value when u create it to a variable (i did $member_id)
<?php //Main $sBasePath = 'http://blah.com/editor/'; $member_id = 'new_editor_name'; $oFCKeditor = new FCKeditor($member_id) ; $oFCKeditor->BasePath = $sBasePath ; $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Value = $text;//set this to whatever $oFCKeditor->Create() ; ?>
Also right above the "submit" button you must add this line:
<input type="hidden" value="<? echo $member_id;?>" name="id_edit">
-----------------------------------------
Then in your post data file make the following mods:
$id1 = $_POST['id_edit'];
<p>updated article id: <? echo $id1; ?></p> (this will show the name you used to create the editor)
<p>updated to: <br><? echo $_POST[$id1];?></p> (this will show the contents of the editor.
hope this helps! It sure helped me!
RE: Getting value from FCK editor for PHP