尝试从mysql中检索数据时iframe无法正常工作

时间:2016-10-03 13:22:38

标签: javascript php mysql iframe

我试图为我的网页制作所见即所得。我按照我发现的一个教程,除了当我尝试添加php代码从mySQL检索数据以便我可以更新我的页面时,它的效果很好。我需要添加到iframe中以便它可以与服务器一起使用吗?

当我添加php代码以从mySQL检索数据时,iframe文本区域停止工作。

当我用这样的网址测试时

http://localhost/site-test/admin-cms/pages/edits/test-page.php

文本框有效,但当我尝试使用看起来像这个

的网址时

http://localhost/site-test/admin-cms/pages/edits/edit-main-btn.php?main_page=9

文本框停止工作。

我的iframe中是否缺少某些代码,使其可以在我的所有页面之间工作,以便我可以编辑我的页面?

<div class="ttt-board">
  <section class="top-row">
    <button class="tp-left btn" value=" "></button>
    <button class="tp-mid btn" value=" "></button>
    <button class="tp-right btn" value=" "></button>
  </section>

  <section class="mid-row">
    <button class="md-left btn" value=" "><span class="x">x</span>
    </button>
    <button class="md-mid btn" value=" "><span class="o">o</span>
    </button>
    <button class="md-right btn" value=" "></button>
  </section>

  <section class="bottom-row">
    <button class="bm-left btn" value=" "></button>
    <button class="bm-mid btn" value=" "></button>
    <button class="bm-right btn" value=" "></button>
  </section>
</div>

在header.php文件中我有

<!--!!!!!This needs to Be HERE Don't MOVE IT!!!!!! -->
<?php require_once("includes/initialize.php"); ?>
<!--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

<?php $layout_context = "admin-w/navigation"; ?>

<?php include_layout_template('header.php'); ?>


<form action="my_parse_file.php" name="myform" id="myform" method="post">
<p>Menu name:
        <input type="text" name="btn_name" value="" />
      </p>
      <p>Position:
        <select name="position">
            <?php
            $main_new = new Main_Navigation;
                $main_btnNav_set = $main_new->find_all_main_cmsNav_btns(false);
                $main_btnNav_count = mysqli_num_rows($main_btnNav_set);
                for($count=1; $count <= ($main_btnNav_count + 1); $count++) {
                    echo "<option value=\"{$count}\">{$count}</option>";
                }
            ?>
        </select>
      </p>
      <p>Visible:
        <input type="radio" name="visible" value="0" /> No
        &nbsp;
        <input type="radio" name="visible" value="1" /> Yes
      </p>
<p>Entry Body:<br>
<div id="wysiwyg_cp" style="padding:8px; width:700px;">
 <input type="button" onClick="iBold()" value="B"> 
  <input type="button" onClick="iUnderline()" value="U">
<input type="button" onClick="iItalic()" value="I">
<input type="button" onClick="iFontSize()" value="Text Size">
<input type="button" onClick="iForeColor()" value="Text Color">
<input type="button" onClick="iHorizontalRule()" value="HR">
<input type="button" onClick="iUnorderedList()" value="UL">
<input type="button" onClick="iOrderedList()" value="OL">
<input type="button" onClick="iLink()" value="Link">
<input type="button" onClick="iUnLink()" value="UnLink">
</div>
<!-- Hide(but keep)your normal textarea and place in the iFrame replacement     for it -->
<textarea style="display:none;" name="myTextArea" id="myTextArea" cols="100" rows="14"></textarea>
<iframe name="richTextField" id="richTextField" style="border:#000000 1px  solid; width:700px; height:300px;"></iframe>
<!-- End replacing your normal textarea -->
</p>
<br /><br /><input name="myBtn" type="button" value="Submit Data"   onClick="javascript:submit_form();"/>
</form>

<?php include_layout_template('test-footer.php'); ?>

0 个答案:

没有答案