phpフロントデータ表示

1094 ワード

<pre name="code" class="html">	
	public function show(){
		echo "   index    show  !!";
		echo "   ".$_GET['name'].'     '.$_GET['age'];
		$m=M('user');
	
	    $id=$_GET['id'];
		$arr=$m->where("id=$id")->getField('username');
		//var_dump($arr);
		$this->assign('data',$arr);
		$this->display();
	}

$this->assign('data',$arr);      data      

$this->display();       

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
<h1>helloworld----<{$data}></h1> 
 </body>
</html>



    :

http://localhost/thinkphp/index.php/Index/show/id/7