这里的形式:笨:为什么笨思维形式是一个GET请求而不是POST请求
<?php echo form_open('locker_settingstwo/processform', array('class' => 'form-horizontal')); ?>
<div class = "lockersettingstwodiv">
<h2><?php echo $this->session->userdata('labelname'); ?></h2>
<p> Control who can view/ReGemz the collection in this locker </p>
<input type = "text" name = "testing" value = "" />
<input type="radio" name="permission" value="1" /> Public - Others can view/edit this locker<br/>
<input type="radio" name="permission" value="2" /> Me Only - Only you can view/edit this locker<br/>
<input type="radio" name="permission" value="custom" /> Custom - Locked to everyone, meaning only friends I choose can view/edit this locker<br/>
</div>
<input type="submit" name = "Next" value="Next" class="btn btn-large btn-primary" style="margin-left: 0px; margin-top: 14px" />
<input type="submit" name = "Cancel" value="Cancel" class="btn btn-large btn-primary" style="margin-left: 0px; margin-top: 14px" />
<?php echo form_close(); ?>
现在
当我打印$ _ SERVER [“REQUEST_METHOD”],它说GET ,而不是POST ......为什么是这样?
这里是形式发送到控制器的方法:
function processform()
{
echo $_SERVER['REQUEST_METHOD'];
}
您何时打印$ _SERVER ['REQUEST_METHOD']? – sikander 2012-07-19 03:23:36
$ this-> input-> server('REQUEST_METHOD')返回什么? – 2012-07-19 03:25:43
form_open默认使用POST方法,因此除非您在其他地方执行服务器请求方法,否则它无法使用。如果它实际上是GET,那么一旦你在处理表单的文件上使用print_r($ _ POST)就不会得到任何东西。 – 2012-07-19 03:26:31