<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Hello extends CI_Controller {
public function index()
{
echo "Hello CodeIgniter!";
}
public function showval($name){
//访问路径:http://localhost/ci/index.php/hello/showval/Tom
$this->name=$name;
@$num=file_get_contents('./num.txt');//加上@屏蔽警告提示(第一次运行没有TXT文件会有警告提示)
$num=$num?$num:0;
$num++;
$arr=array('v_name'=>$name,'v_num'=>$num);
$re=fopen('./num.txt','w');
fwrite($re,$num);
fclose($re);
$this->load->view('test_views',$arr);
}
}
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>访问统计</title> </head> <body> <?php echo $v_name;?>是第 <?php echo $v_num;?> 位访问者 </body> </html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有