从模版页index.html怎么提交数据?

浏览:955 发布日期:2015/05/14 分类:求助交流
<form method="post" id="login_form" action="{:U(__SELF__/verify_login)}">
<div> 邮件:
<input type="text" id="email" name="email" />
用户名:
<input type="text" id="user_name" name="user_name" />
密码:
<input type="text" id="pass_word" name="pass_word" />
</div>
<div>
<input type="submit" name="submit" value="提交" />
</div>
</form>

这样的话,点了‘提交’按钮,地址栏变成了:
index.php/test/index/index/verify_login.html
我的问题是:
1. 这个index.php怎么又出来了,我用的URL_MODEL是REWRITE的啊?
2. 这种方法的‘提交’有没有经过PHP端的verify_login方法呢?
3. 如果经过了verify_login方法,怎么没有dump出数据呢?
public function verify_login(){
dump($_POST);
}
4. 我换成下面这样,也没有数据:
public function verify_login(){
echo 'me run';
#dump($_POST);
}

==========解决方法=========
action="{:U(__SELF__/verify_login)}"
换成
action="__URL__/verify_login"
这样就提交到了verify_login方法,me run就出来了。
__URL__是一个常量定义,表示当前模块地址,TP模板引擎会自动将这句解释为/index.php/test/Index/verify_login


==========延伸问题=========
为啥解释结果多了'index.php'?
最佳答案
评论( 相关
后面还有条评论,点击查看>>