PDA

View Full Version : سوال: fckeditor



samrand_7
سه شنبه 20 مرداد 1388, 18:49 عصر
سلام خسته نباشيد .
من از fckeditor استفاده ميکنم .مشکلي که دارم مي خواهم در پايگاه داده ذخيرش کنم .
نمي دونم چجوري مي شه :
من يک فيلد از نوع ntext درست کردم . فقط چون editor از کلاس استفاده ميکنه نمي دونم چه جوري ذخيرش کنم .البته من صفجه را include کردم , کد مثالي که همراه خود برنامست را زير مي نويسم و ممنون ميشم کمکم کنيد ,خيلي ضروريه!!!!!!!!!!!
کد صفحه شامل editor :
<?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, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = $sBasePath ;
if ( isset($_GET['Lang']) )
{
$oFCKeditor->Config['AutoDetectLanguage'] = false ;
$oFCKeditor->Config['DefaultLanguage'] = $_GET['Lang'] ;
}
else
{
$oFCKeditor->Config['AutoDetectLanguage'] = true ;
$oFCKeditor->Config['DefaultLanguage'] = 'fa' ;
}
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' (http://www.fckeditor.net/&quot;>FCKeditor</a>.</p>') ;
$oFCKeditor->Create() ;
?> <br>
<input type="submit" value="ارسال">
</form>
کد مربوط به صفحه اي که اطلاعات به آن post مي شه :
<table border="1" cellspacing="0" id="outputSample">
<colgroup><col width="80"><col></colgroup>
<thead>
<tr>
<th>Field Name</th>
<th>Value</th>
</tr>
</thead>
<?php
if ( isset( $_POST ) )
$postArray = &$_POST ; // 4.1.0 or later, use $_POST
else
$postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS
foreach ( $postArray as $sForm => $value )
{
if ( get_magic_quotes_gpc() )
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
else
$postedValue = htmlspecialchars( $value ) ;
?>
<tr>
<th><textarea name="text" style="background-color:#0CF" ><?php echo $sForm?></textarea></th>
<td><textarea name="text" style="background-color:#0CF"><?php echo $postedValue?></textarea>
</td>
</tr>
<?php
}
?>
</table>
به نظر شما editor راحتتري مي شناسيد , چون اين دردسرش خيلي زياده و خيلي کامل ؟
نظرتون چيه ؟