2

よろしくお願いします。

TinyMCE テキストフィールドにコンテンツをロードしたいと考えています。

私のコードは次のようになります。

    <?php
    require_once('adminmenu.php');
    $articleid = $_GET['id'];
    require_once('core/dbconnect.php');

    $qarticles = mysql_query("SELECT * FROM news WHERE id='$articleid' ORDER BY date DESC");
    $row = mysql_fetch_array($qarticles);
    $date = $row['date'];
    $title = $row['title'];
    $shorttitle = $row['shorttitle'];
    $content = $row['content'];
    ?>

    <script src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script>
    <script>
        tinymce.init({selector:'textarea'});
    </script>

    <form name="form" method="post" action="articleedit.php?id=<?php echo $id; ?>" onsubmit="return confirm('Are you sure you want to change article?')">
        <p>
            <label for="newsmgstitle"></label>
            <label for="newsmsgdatetime"></label>
        </p>
        <table border="0">
            <tr>
                <td colspan="2" bgcolor="#000000" style="font-weight: bold; color: #FFF;">NEW NEWS ARTICLE</td>
            </tr>
            <tr>
                <td><strong>TIME & DATE</strong></td>
                <td><input type="text" name="newsmsgdatetime" id="newsmsgdatetime" size="25" value="<?php echo $date; ?>"</td>
            </tr>
            <tr>
                <td><strong>TITLE</strong></td>
                <td><input type="text" name="newsmgstitle" id="newsmgstitle" size="50" value="<?php echo $title; ?>"></td>
            </tr>
            <tr>
                <td><strong>SHORT TITLE</strong></td>
                <td><input type="text" name="newsmsgshortitle" id="newsmsgshortitle" size="25" maxlength="25" value="<?php echo $shorttitle; ?>"></td>
            </tr>
            <tr>
                <td colspan="2"><strong>ARTICLE</strong><br>
                    <textarea name="newsmsg" id="newsmsg" cols="80" rows="20" value="<?php echo $content; ?>"></textarea></td>
            </tr>
            <tr>
        <td colspan="2"><input type="submit" name="submitnewsmsg" id="submitnewsmsg" value="PUBLISH ARTICLE"></td>
            </tr>
        </table>
    </form>

ご覧のとおり、テキストフィールドで value=" を実行しましたが、うまくいかないようです。どなたか教えていただけないでしょうか?

4

1 に答える 1

7

テキストエリアのコンテンツは、次のようなテキストエリア タグで囲まれます。

<textarea name="newsmsg" id="newsmsg" cols="80" rows="20" ><?= htmlspecialchars($content); ?></textarea>
于 2013-06-12T02:22:26.557 に答える