梦幻之旅

DEBUG - 天道酬勤

   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  671 随笔 :: 6 文章 :: 256 评论 :: 0 Trackbacks
control

 1 <?php
 2 if (! defined ( 'BASEPATH' ))
 3     exit ( 'No direct script access allowed' );
 4 class Hello extends CI_Controller {
 5     public function sayHello() {
 6         $name = "huiwanpeng";
 7         @$count =file_get_contents('./num.txt');
 8         
 9         $count = $count ? $count : 0;
10         $count = $count + 1;
11         
12         $re = fopen('./num.txt', 'w'); 
13         fwrite($re$count);
14         fclose($re);
15         
16         $data = Array("name"=>$name,"count"=>$count);
17         $this->load->view ( "test_view",$data);
18         //echo "helloa";
19     }
20 } 

view

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
 <?php echo  $name ?>
 <?php echo  $count ?>
</body>
</html>




posted on 2013-09-25 16:23 HUIKK 阅读(260) 评论(0)  编辑  收藏 所属分类: php

只有注册用户登录后才能发表评论。


网站导航: