Home >Backend Development >PHP Tutorial >封装的calss怎么获取html的文本框内容

封装的calss怎么获取html的文本框内容

WBOY
WBOYOriginal
2016-06-20 12:40:49898browse

网站是ThinkPHP框架

我的html代码

<form id="form1" name="form1" method="post" action="/admin.php/Home/Index/zckq"/><li>                  <input name="test" type="text" id="test" class="dfinput" value=""/></li>                 <li><label> </label><input  type="submit" class="btn" value="确认保存"/>          </li>  </form>


然后有个封装的indexcontroller.class.php文件,调用内容是;

   public function zckq()    {        M('aconfig')->where(array('ID' => 1))->save(array('zcoff' => 这里的值我想是html文本框TEST的内容,怎么操作,我用".$_POST['test']."这样提示错误));        // 		$time2 = date('H');00]0[/color]));         注册系统       $this->success('开启成功!');    }	




回复讨论(解决方案)

在前端页面通过ajax把表单的数据传到php就可以获取到对应的值

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn