Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress管理页面剥离表单标签_Php_Html_Forms_Wordpress - Fatal编程技术网

Php Wordpress管理页面剥离表单标签

Php Wordpress管理页面剥离表单标签,php,html,forms,wordpress,Php,Html,Forms,Wordpress,我在wordpress中编写了一个php页面,它应该从数据库中获取一些信息并显示到页面上。我正在尝试添加直接从页面更新信息的功能,似乎有什么东西正在剥离我的第一个表单标记,但其他的没有。有没有人见过这样的事情,或者知道可能发生的事情 这里是PHP function display_terms_by_brand() { global $wpdb; $sql = "SELECT * FROM ".NINJA_FORMS_TERMS_TEXT; $terms = $wpdb->get_resul

我在wordpress中编写了一个php页面,它应该从数据库中获取一些信息并显示到页面上。我正在尝试添加直接从页面更新信息的功能,似乎有什么东西正在剥离我的第一个表单标记,但其他的没有。有没有人见过这样的事情,或者知道可能发生的事情

这里是PHP

function display_terms_by_brand()
{
global $wpdb;
$sql = "SELECT * FROM ".NINJA_FORMS_TERMS_TEXT;
$terms = $wpdb->get_results($sql, ARRAY_A);
?>

<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery('.edit').click(function(){
            jQuery(this).parent().find('.edit').css('display' , 'none')
            jQuery(this).parent().find('.save').css('display' , 'block')
            jQuery(this).parent().siblings('span[id*=brand_text_]').children('span').toggle();
            jQuery(this).parent().siblings('span[id*=brand_text_]').children('textarea').toggle();
        }); 
    })
</script>

<div id="termsHeader" style="font-weight:bold; font-size:16px; padding:10px 0; height:30px; min-width:600px;">
    <span style="width:10%; text-align:center; float:left; padding:0 30px;">Brand</span>
    <span style="width:67%; text-align:center; float:left;">Text</span>
    <span style="width:9%; text-align:center; float:right; padding:0 15px;">Edit / Save</span>
</div>

<div style="clear:both;"><!-- --></div>
<hr />

<?php
foreach($terms as $curr_term) {
?>

    <div style="width:100%; padding:20px 0; min-width:600px;" class="term">
        <span style="width:10%; height:50px; padding:30px; float:left; text-align:center;" id="brand_name_<?php echo $curr_term['text_id'] ?>">
            <?php echo $curr_term['brand_name'] ?>
        </span>
        <span style="width:67%; height:50px; padding:30px 10px; float:left;" id="brand_text_<?php echo $curr_term['text_id'] ?>">
            <span> <?php echo stripslashes($curr_term['brand_text']) ?> </span>
            <textarea style="display:none; width:100%;"><?php echo stripslashes($curr_term['brand_text']) ?></textarea>
        </span>
        <span style="width:12%; height:50px; padding:30px 10px; float:right;">
            <form action="/wp-admin/admin.php?page=ninja-forms-extend" method="post" name="edit_<?php echo $curr_term['text_id'] ?>" id="edit_<?php echo $curr_term['text_id'] ?>">
                <input name="brand_name" type="hidden" value="<?php echo $curr_term['brand_name'] ?>" />
                <textarea name="brand_text" style="display:none;">TEST</textarea>
                <input class="termsEditButton termsButtons edit" style="width:150px; margin:0 auto; display:block;" name="edit" type="button" value="Edit Optin Statement" />  
                <input class="termsSaveButton termsButtons save" style="width:150px; margin:0 auto; display:none;" name="save" type="button" value="Save Optin Statement" />  
                <input class="termsDeleteButton termsButtons delete" style="width:150px; margin:0 auto; display:block;" name="delete" type="button" value="Delete Optin Statement" />  
            </form>
        </span>
    </div>

    <div style="clear:both;"><!-- --></div>
<?php
}
?>


<hr />
<h2>Add New Terms text</h2>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>?page=ninja-forms-extend" method="post" name="add_new_term_text" id="add_new_term_text">
    <label style="float:left;width:50px;clear:left;font-weight:bold">Brand</label><input name="brand_name" type="text" size="38" />&nbsp;&nbsp;(This will be the shortcode to display the text)<br />
    <label style="float:left;width:50px;clear:left;font-weight:bold">Text</label><textarea name="brand_text" cols="35" rows="5"></textarea><br />
    <input name="submit" type="submit" value="Add New Terms Text" />
</form>
<?php
return;
}
功能显示\u术语\u按品牌()
{
全球$wpdb;
$sql=“SELECT*FROM.”忍者表单条款文本;
$terms=$wpdb->get_results($sql,ARRAY_A);
?>
jQuery(文档).ready(函数(){
jQuery('.edit')。单击(函数(){
jQuery(this).parent().find('.edit').css('display','none'))
jQuery(this).parent().find('.save').css('display','block'))
jQuery(this).parent().sibbins('span[id*=brand_text_]')).children('span').toggle();
jQuery(this).parent().sides('span[id*=brand_text_]')).children('textarea').toggle();
}); 
})
烙印
正文
编辑/保存


我也遇到了同样的问题。结果我完全忽略了一个事实,那就是我在主选项表单中引入了表单。

删除该元素可能是流氓javascript吗?我在chrome中禁用了javascript,问题仍然存在
<div style="width:100%; padding:20px 0; min-width:600px;" class="term">
        <span style="width:10%; height:50px; padding:30px; float:left; text-align:center;" id="brand_name_1">
            caprizehouse            </span>
        <span style="width:67%; height:50px; padding:30px 10px; float:left;" id="brand_text_1">
            <span> I certify that I am a resident of Canada over the age of 18, I agree to the <a href="http://coreg.intela.com/media/ca-prizehouse/privacypolicy.htm" class="fancylink" target="_blank">Privacy Policy</a> and <a href="http://coreg.intela.com/media/ca-prizehouse/terms.htm" class="fancylink" target="_blank">Terms and Conditions</a>, and I would like to receive the Canadian Prize House newsletter. </span>
            <textarea style="display:none; width:100%;">I certify that I am a resident of Canada over the age of 18, I agree to the &lt;a href="http://coreg.intela.com/media/ca-prizehouse/privacypolicy.htm" class="fancylink" target="_blank"&gt;Privacy Policy&lt;/a&gt; and &lt;a href="http://coreg.intela.com/media/ca-prizehouse/terms.htm" class="fancylink" target = "_blank"&gt;Terms and Conditions&lt;/a&gt;, and I would like to receive the Canadian Prize House newsletter.</textarea>
        </span>
        <span style="width:12%; height:50px; padding:30px 10px; float:right;">

                <input name="brand_name" type="hidden" value="caprizehouse">
                <textarea name="brand_text" style="display:none;">TEST</textarea>
                <input class="termsEditButton termsButtons edit" style="width:150px; margin:0 auto; display:block;" name="edit" type="button" value="Edit Optin Statement">  
                <input class="termsSaveButton termsButtons save" style="width:150px; margin:0 auto; display:none;" name="save" type="button" value="Save Optin Statement">  
                <input class="termsDeleteButton termsButtons delete" style="width:150px; margin:0 auto; display:block;" name="delete" type="button" value="Delete Optin Statement">  

        </span>
    </div>
<div style="width:100%; padding:20px 0; min-width:600px;" class="term">
        <span style="width:10%; height:50px; padding:30px; float:left; text-align:center;" id="brand_name_2">
            canadianprizes          </span>
        <span style="width:67%; height:50px; padding:30px 10px; float:left;" id="brand_text_2">
            <span> I certify that I am a Canadian resident above the age of 18 years and I agree to and accept the  <a target="_blank" class="fancylink" href="http://www.canadianprizes.com/media/canadianprizes/terms.jspx"> Terms and Conditions</a>, <a target="_blank" class="fancylink" href="http://www.canadianprizes.com/media/canadianprizes/privacy.jspx">Privacy Policy</a> and <a target="_blank" class="fancylink" href="http://www.canadianprizes.com/media/canadianprizes/prizepolicy.jspx">Competition Rules</a>. I consent to my personal details being provided to  selected clients, sponsors and affiliates and to being contacted via email, phone, SMS or mail, as described in the Privacy Policy. </span>
            <textarea style="display:none; width:100%;">I certify that I am a Canadian resident above the age of 18 years and I agree to and accept the  &lt;a target="_blank" class="fancylink" href="http://www.canadianprizes.com/media/canadianprizes/terms.jspx"&gt; Terms and Conditions&lt;/a&gt;, &lt;a target="_blank" class="fancylink" href="http://www.canadianprizes.com/media/canadianprizes/privacy.jspx"&gt;Privacy Policy&lt;/a&gt; and &lt;a target="_blank" class="fancylink" href="http://www.canadianprizes.com/media/canadianprizes/prizepolicy.jspx"&gt;Competition Rules&lt;/a&gt;. I consent to my personal details being provided to  selected clients, sponsors and affiliates and to being contacted via email, phone, SMS or mail, as described in the Privacy Policy.</textarea>
        </span>
        <span style="width:12%; height:50px; padding:30px 10px; float:right;">
            <form action="/wp-admin/admin.php?page=ninja-forms-extend" method="post" name="edit_2" id="edit_2">
                <input name="brand_name" type="hidden" value="canadianprizes">
                <textarea name="brand_text" style="display:none;">TEST</textarea>
                <input class="termsEditButton termsButtons edit" style="width:150px; margin:0 auto; display:block;" name="edit" type="button" value="Edit Optin Statement">  
                <input class="termsSaveButton termsButtons save" style="width:150px; margin:0 auto; display:none;" name="save" type="button" value="Save Optin Statement">  
                <input class="termsDeleteButton termsButtons delete" style="width:150px; margin:0 auto; display:block;" name="delete" type="button" value="Delete Optin Statement">  
            </form>
        </span>
    </div>