2011-05-18 91 views
0

我有一个表单,我已经创建用作我的插件设置的选项页面。 但是,当我提交表格时,它没有被提交。表单没有在wordpress中提交:

我的表单的代码如下

<div class="wrap"> 
<?php echo "<h2>"._('My Plugin Options')."</h2";?> 
<form name="my_plugin_form" method="POST" action="<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>"> 
    <input type="hidden" name="img_hidden" value="Y"> 
    <?php echo "<h4>"._('Image Dispaly Options')."</h4>";?> 
    <p><?php _e("Image Height: "); ?><input type="text" name="img_height" value="<?php echo $height; ?>" size="20"></p> 
    <p><?php _e("Image Width: "); ?><input type="text" name="img_width" value="<?php echo $width; ?>" size="20"></p> 

    <p class="submit"> 
    <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /> 
    </p> 
</form> 

用于处理表单的代码也写在同一个页面。

如果您知道解决方案,请与我分享。我是wordpress插件开发的初学者。

在此先感谢..

回答

0

尝试了这一点:

<div class="wrap"> 
    <?php echo "<h2>".__('My Plugin Options')."</h2";?> 
    <form name="my_plugin_form" method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>"> 
    <input type="hidden" name="img_hidden" value="Y"> 
    <?php echo "<h4>".__('Image Dispaly Options')."</h4>";?> 
    <p><?php echo __("Image Height: "); ?><input type="text" name="img_height" value="<?php echo $height; ?>" size="20"></p> 
    <p><?php echo __("Image Width: "); ?><input type="text" name="img_width" value="<?php echo $width; ?>" size="20"></p> 

    <p class="submit"> 
    <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /> 
    </p> 
</form>