var url=system.php?m=Login&a=doLog; $.post(url,{staffname:$staffname,staffpwd:$staffpwd,verifycode:$verifycode},function(data){ if(data==codeerr){ alert(验证码错误!); }else if(data==authempty){ alert(请输入用户名或密码!) }else if(data==autherr){ alert(用户名或密码错误!); }else if(data==success){ alert(登录成功!); location.href=system.php?m=Index&a=index; //访问首页 }
var url=doLog; $.post(url,{staffname:$staffname,staffpwd:$staffpwd,verifycode:$verifycode},function(data){ if(data==codeerr){ alert(验证码错误!); }else if(data==authempty){ alert(请输入用户名或密码!) }else if(data==autherr){ alert(用户名或密码错误!); }else if(data==success){ alert(登录成功!); location.href=../Index/index; //跳转首页,访问其他模块的方法
ob_start(); ob_end_clean(); Header( Content-type: application/octet-stream); Header( Accept-Ranges: bytes ); Header( Content-type:application/vnd.ms-excel;charset=gb2312); Header( Content-Disposition:attachment;filename={$filename}.xls);
$path=./Public/uploads/; $path=str_replace(Deploy ThinkPHP on Nginx and solve the Pathinfo problem_PHP tutorial,/,realpath($path)./); //获取绝对路径,并转换分隔符
location ~ .php/?.* { root myapplications; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; #定义变量 $path_info ,用于存放pathinfo信息 set $path_info ; #定义变量 $real_script_name,用于存放真实地址 set $real_script_name $fastcgi_script_name; #如果地址与引号内的正则表达式匹配 if ($fastcgi_script_name ~ ^(.+?.php)(/.+)$) { #将文件地址赋值给变量 $real_script_name set $real_script_name $1; #将文件地址后的参数赋值给变量 $path_info set $path_info $2; } #配置fastcgi的一些参数 fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; }
《PHP框架ThinkPHP学习》系列技术文章整理收藏
1Thinkphp实现MySQL读写分离操作示例
2使用ThinkPHP+Uploadify实现图片上传功能
3ThinkPHP调用百度翻译类实现在线翻译
4Thinkphp使用mongodb数据库实现多条件查询方法
5ThinkPHP实现多数据库连接的解决方法
6改写ThinkPHP的U方法使其路由下分页正常
7ThinkPHP实现将SESSION存入MYSQL的方法
8ThinkPHP连接数据库及主从数据库的设置教程
9ThinkPHP中pathinfo的访问模式、路径访问模式及URL重写总结
10ThinkPHP基于PHPExcel导入Excel文件的方法
11thinkphp获取栏目和文章当前位置的方法
12ThinkPHP结合AjaxFileUploader实现无刷新文件上传的方法
13ThinkPHP无限级分类原理实现留言与回复功能实例
14ThinkPHP在新浪SAE平台的部署实例
15ThinkPHP控制器间实现相互调用的方法
16ThinkPHP实现带验证码的文件上传功能实例
17ThinkPHP写数组插入与获取最新插入数据ID实例
18ThinkPHP水印功能实现修复PNG透明水印并增加JPEG图片质量可调整
19thinkphp使用literal防止模板标签被解析的方法
20ThinkPHP中RBAC类的四种用法分析
21ThinkPHP中__initialize()和类的构造函数__construct()用法分析
22ThinkPHP自动完成中使用函数与回调方法实例
23ThinkPHP’s method of dynamically including files
24thinkphp implements sending email password retrieval function example
25ThinkPHP implementation example of Alipay interface function
26 How to maintain conditional paging on home page and search page during Thinkphp search
27ThinkPHP entry file settings and related precautions analysis
28Detailed explanation of variable output of ThinkPHP template engine
29thinkphp method to implement the previous and next articles
30 How to receive the value passed by alipay after hiding the entry file in url in ThinkPHP
31ThinkPHP solution to the problem that garbled characters appear when opening the verification code page
32 How to use ajax to receive json data in ThinkPHP
33Defect analysis of ThinkPHP’s built-in jsonRPC
34 Solution to the problem that thinkphp3.0 output is repeated twice
35thinkPHP implements automatic form verification
36 Practical points of curd application in Thinkphp
37 A brief discussion on thinkphp’s instantiation model
38ThinkPHP 404 page setting method
39THINKPHP content pagination code sharing
40 tutorial on deploying ThinkPHP project on Nginx
41 A brief analysis of the maximum data amount supported by THINKPHP’s addAll
Solution to 42ThinkPHP prompt error Fatal error: Allowed memory size
43ThinkPHP3.2.2 plug-in controller function
44ThinkPHP3.2.3 new database setting features
45What has been upgraded in ThinkPHP 3.2 version
46thinkPHP Study Notes Installation and Configuration
47Thinkphp calls the Image class method to generate thumbnails
48 Summary of solving the problem of error when ThinkPHP closes debugging mode
49ThinkPHP file caching code sharing