CKEditor和CkFinder在PHP中工作良好,但不';不显示图像、闪光灯等

CKEditor和CkFinder在PHP中工作良好,但不';不显示图像、闪光灯等,php,ckeditor,ckfinder,Php,Ckeditor,Ckfinder,我正在使用CKEditor和CKFinder。两者都很好。当我浏览(或直接复制)一个图像(或flash)到CKEditor时,它会显示在其中并插入到MySql数据库中 a在将其插入MySql数据库之后,我尝试将其显示在一个HTML表中,在该表中不显示它,而显示备用文本 通过CKFinder浏览图像后的图像路径如下所示 <img alt="" src="/ckfinder/userfiles/images/1243_SS_2502.jpg" style="width: 490px; heig

我正在使用CKEditor和CKFinder。两者都很好。当我浏览(或直接复制)一个图像(或flash)到CKEditor时,它会显示在其中并插入到MySql数据库中

a在将其插入MySql数据库之后,我尝试将其显示在一个HTML表中,在该表中不显示它,而显示备用文本

通过CKFinder浏览图像后的图像路径如下所示

<img alt="" src="/ckfinder/userfiles/images/1243_SS_2502.jpg" style="width: 490px; height: 618px;" />
<c:out value="${str}" default="No content found." escapeXml="false"/>
用蒸馏器试过,它不起作用。在使用JSTL/EL处理JSP时,我必须执行以下操作

<img alt="" src="/ckfinder/userfiles/images/1243_SS_2502.jpg" style="width: 490px; height: 618px;" />
<c:out value="${str}" default="No content found." escapeXml="false"/>

编辑:

<?php include_once("Lock.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Wagafashion</title>

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<link rel="stylesheet" href="css/template.css" type="text/css"/>
<!--<script type="text/javascript" language="javascript" src="ckeditor/ckeditor.js"></script>-->
<script src="js/jquery-1.6.min.js" type="text/javascript"></script>        
<script src="js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>

<script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script><script>
    jQuery(document).ready(function(){
        // binds form submission and fields to the validation engine
        jQuery("#dataForm").validationEngine();
    });            
</script>

<script language="javascript" type="text/javascript">
    function deleteSingle(id)
    {       
        var delId=confirm("About us with the id "+id+" is about to be deleted permanently.\n\nAttention : This action will never be undone!\n\nAre you sure...???");        
        return(delId==true?true:false);
    }

</script>

</head>

<body>
<?php
    include_once("Connection.php");
    include_once("ckeditor/ckeditor.php");
    $con=new Connection();
    $con->get_connection();

    $ed_about_us="";
    $flag=-1;
    $msg="";

    if(isset($_POST['btnSubmit']))
    {
        $act=trim($_POST['param_action']);
        $about_us=$_POST['cms_description'];        

        if($act=="add")
        {   
            $res=$con->get_data("select count(*) as cnt from cms"); 
            $cnt_cmt=mysql_result($res, 'cnt');

            if($cnt_cmt==0)
            {
                $flag=$con->iud("insert into cms (about_us)values('".mysql_real_escape_string(urlencode($about_us))."')");              
            }
            else
            {
                $flag=$con->iud("update cms set about_us='".mysql_real_escape_string(urlencode($about_us))."'");
            }

            if($flag==1)
            {
                $msg="Insertion done successfully.";        
            }
            else if($flag==0)
            {
                $msg="Insertion failed - reason : ".mysql_errno()." : ".mysql_error();  
            }
        }
        else if($act=="edit")
        {
            $cms_id=$_POST['cms_id'];
            $flag=$con->iud("update cms set about_us='".mysql_real_escape_string(urlencode($about_us))."' where id=".$cms_id."");               
            if($flag==1)
            {
                $msg="About us has been updated successfully.";
            }
            else if($flag==0)
            {
                $msg="Updation failed - reason : ".mysql_errno()." : ".mysql_error();   
            }           
        }
    }           
    else if(isset($_GET['ed_id']))
    {
        $ed_res=$con->get_data("select about_us from cms where id=".$_GET['ed_id'].""); 

        while($row=mysql_fetch_assoc($ed_res))
        {
            $ed_about_us=$row['about_us'];      
        }
    }   
    else if(isset($_GET['del_id']))
    {
        $flag=$con->iud("update cms set about_us='' where id=".$_GET['del_id']);
        if($flag==1)
        {
            $msg="About us been deleted successfully.";
        }
        else if($flag==0)
        {
            $msg="Can not delete - reason : ".mysql_errno()." : ".mysql_error();    
        }
    }
    else if(isset($_POST['btnDelete']))
    {
        $set_del=$_POST['setDel'];
        $flag=$con->iud("update cms set about_us='' where id in($set_del)");
        $size=sizeof(split(",", $set_del));

        if($flag==1)
        {
            if($size==1)
            {
                $msg="1 row deleted.";  
            }
            else
            {
                $msg=$size." rows deleted.";    
            }           
        }
        else if($flag==0)
        {
            $msg="Can not perform deletion - reason : ".mysql_errno()." : ".mysql_error();  
        }       
    }
?>

    <?php include("tamplate/Template1.php");?>
        <h2>About Us</h2>
    <?php include("tamplate/NewTemplate.php");?>

    <?php
        if($flag==1)
        {        
            echo "<p>";
            ?>
                <!--[if !IE]>start system messages<![endif]-->
                <ul class="system_messages">                                     
                    <li class="green"><span class="ico"></span><strong class="system_title"><?php echo $msg; ?></strong></li>                    
                </ul>
                <!--[if !IE]>end system messages<![endif]-->
            <?php               
            echo "</p>";
        }
        else if($flag==0)
        {     
            echo "<p>";
            ?>
                <!--[if !IE]>start system messages<![endif]-->
                <ul class="system_messages">                    
                    <li class="red"><span class="ico"></span><strong class="system_title"><?php echo $msg; ?></strong></li>                                        
                </ul>
                <!--[if !IE]>end system messages<![endif]-->
            <?php               
            echo "</p>";    
        }
    ?>
<img alt=\"\" src="/ckfinder/userfiles/images/1243_SS_2502.jpg" style=\"width: 490px; height: 618px;\" />
      <!--[if !IE]>start forms<![endif]-->
    <form action="<?php $_SERVER['PHP_SELF']; ?>" id="dataForm" name="dataForm" method="post" class="search_form general_form">
        <!--[if !IE]>start fieldset<![endif]-->
        <fieldset>
            <!--[if !IE]>start forms<![endif]-->
            <div class="forms">

            <!--[if !IE]>start row<![endif]-->
            <div class="row">   
            <?php
                $ckeditor = new CKEditor();
                $ckeditor->basePath = 'ckeditor/';
                $ckeditor->config['filebrowserBrowseUrl'] = 'ckfinder/ckfinder.html';
                $ckeditor->config['filebrowserImageBrowseUrl'] = 'ckfinder/ckfinder.html?type=Images';
                $ckeditor->config['filebrowserFlashBrowseUrl'] = 'ckfinder/ckfinder.html?type=Flash';
                $ckeditor->config['filebrowserUploadUrl'] = 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
                $ckeditor->config['filebrowserImageUploadUrl'] = 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
                $ckeditor->config['filebrowserFlashUploadUrl'] = 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
                $ckeditor->editor('cms_description', urldecode($ed_about_us));

            ?>             

            <!--[if !IE]>start row<![endif]-->
            <div class="row">
                <div class="buttons">                                                                                                                                                   
                        <span class="button send_form_btn"><span><span>Submit</span></span><input type="submit" value="Submit" id="btnSubmit" name="btnSubmit" onclick="return validate();"></span>                    
                </div>
            </div>
            <!--[if !IE]>end row<![endif]-->
            </div>
        </fieldset>

        <!--[if !IE]>end fieldset<![endif]-->                
        <input type="hidden" id="param_action" name="param_action" value="

            <?php
                if(isset($_GET['ed_id']))
                {
                    echo "edit";        
                }
                else
                {
                    echo "add"; 
                }
            ?>
            " />

            <input type="hidden" id="cms_id" name="cms_id" value="<?php echo isset($_GET['ed_id'])?$_GET['ed_id']:"";?>" />            
    </form>            

    <?php include("tamplate/Template2.php");?>
        <h2>About Us</h2>
    <?php include("tamplate/NewTemplate1.php");?>   


    <form action="<?php echo $_SERVER['PHP_SELF'];?>" id="mainForm" name="mainForm" method="post">                                                

        <?php include("tamplate/ExtraTemplate.php");?>      

            <table cellpadding="0" cellspacing="0" width="100%">
                <tbody>
                <th style="width: 10px;">Check</th>
                <th style="width: 450px;">About Us</th>                
                <th style="width: 10px;">Actions</th>

                <?php

                    $get_data=$con->get_data("select id, about_us from cms order by id");
                    $cnt=1;$flag='';

                    while($data_row=mysql_fetch_assoc($get_data))
                    {
                        extract($data_row); 
                        $cnt%2==0?$flag="second":$flag="first";
                        ++$cnt;

                        echo "<tr class='$flag'>";
                        echo "<td><input type='checkbox' name='chk' value='$id'></td>";
                        echo "<td>".urldecode($about_us)."</td>";

                        echo "<td><div class='actions'><ul><li><a href='".$_SERVER['PHP_SELF']."?ed_id=$id' class='action2'></a></li>";
                        echo "<li><a href='".$_SERVER['PHP_SELF']."?del_id=$id&table_name=cms&pri=id' onclick='return deleteSingle($id);' class='action4'></a></li></ul></div></td>";
                        echo "</tr>";
                    }
                ?>

                </tbody>
            </table>    
            <input type='hidden' id='setDel' name='setDel'/>
            <?php include("tamplate/Template3.php");?>         
    </form>
    <?php include("tamplate/Template4.php");?> 
</body>
</html>

瓦加法辛
jQuery(文档).ready(函数(){
//将表单提交和字段绑定到验证引擎
jQuery(“#数据表单”).validationEngine();
});            
函数deleteSingle(id)
{       
var delId=confirm(“关于id为“+id+”的我们”将被永久删除。\n\n注意:此操作将永远不会撤消!\n\n是否确定…?”;
返回(delId==true?true:false);
}

您是否尝试使用
html\u entity\u decode()
显示内容?它将解码编码的html以获得更好的输出。参考文献

编辑
将查询更改为以下内容

insert-into-cms(about_-us)值(“.”.mysql_-real_-escape_-string(urlecode(stripslashes($about_-us)))‌​."')

当您从数据库中获取它时,请使用

urldecode($value)


其中,
$value
是您从数据库获得的块。

尝试过,但没有效果。它显示
,但需要像
,使用
\`转义
是禁止的。早些时候,我使用的是FCKEditor,其中有一种直接的方法,如
$FCKeditorObj->CreateHtml()`但我想在CKEditor中找不到,虽然它应该在那里。你知道吗?在块存储到数据库中之前,它看起来是在转义引号。尝试
urlencode()
然后转义,然后存储到数据库中。当你返回
urlencode()时
然后它显示,
%253Cp%253E%250D%250A%2509%253Cimg%2Balt%253D%255C%2522%2Bsrc%253D%255C%2522%252Fckfinder%252Fuserfiles%URL252fimages%252F1243_ssu 2502。jpg%255C%2522%2Bstyle%255d%255C%2522宽度%253A%2B490px%253B%2B高度%253A%2B618px%253B%255C%255C%2522b%255C%255C%255C解码代码
?看起来您已经进行了两次URL编码!!您在提交到数据库之前是否正在执行
urlencode()
?以及从数据库获取后是否正在执行
urldecode()