tp框架的数据互传

  
IndexController.class.php
 namespace HomeController;
use ThinkController;
class IndexController extends Controller {
    public function index(){
		echo 'nihao ';
		$this->assign("tid",I("get.name"));//提交数据给主页 I("get.name") 获取提交过来的get数据

		$this->assign("sid",I("get.pass"));
			$this->show();
		
    $this->success('新增功','User/list');
    }
}
index.html
 
<form action=""> 
First name:<br> 
<input type="text" name="name" value=""> 
<br> 
Last name:<br> 
<input type="text" name="pass" value=""> 
<br><br> 
<input type="submit" value="Submit"> 


 用户名 {$tid}//获取程序送过来数据
  密码  {$sid}

评论

刷新

友情链接