Re: Php Code inside a link does not work

  •  04-12-2008, 1:10 PM

    Re: Php Code inside a link does not work

    Hi Adam,
     
    It's a bit difficult to explain but I'm trying differently.
     
    First, I store in my database the following value :  '<a target="_blank" href="<?php echo "test"; ?>"> myPhp link </a>'
     
    Second, I retrieve my value in $var, then :
     
        $var contains '<a target="_blank" href="<?php echo "test"; ?>"> myPhp link </a>'
     
    After, I call the editor like that :
     
         <?php
                    $editor=new CuteEditor();
                    $editor->ID="Editor1";
                    $editor->Text=$var;
          ?>

    So, when the file is reading $var cannot be converted here.
     
    But, when I call the editor, it exists the following instruction on line 140 of the file  include_CuteEditor.php :
     
        return htmlspecialchars($s_Text);
     
    ...and if I don't make a mistake htmlspecialchars function convert every special characters like <?... in the url lines. The following example is given on php website :
     
    <?php
    $new 
    htmlspecialchars("<a href='test'>Test</a>"ENT_QUOTES);
    echo 
    $new
    // &lt;a href='test'&gt;Test&lt;/a&gt;
    ?>
     
    It's exactely the conversion I want to avoid.
     
    I already eliminate this conversion, but I guess it exists the same conversion in the javascript files.
     
    The goal to edit php snippet code in the html files allow to execute this code when I display this content on my web site. Of course, I don't want to execute this code in the editor. Before I used the KTML editor and no conversion was operated it's why I hope it will be possible to do the same with CuteEditor.
     
    I hope this new explanation will be better.
     
    Thanks in advance,
    AlES
View Complete Thread