php
文章平均质量分 51
茉莉花茶
这个作者很懒,什么都没留下…
展开
-
Where am I? You need to setup your server names in class.config.php $_SERVER['HTTP_HOST'] reported
昨天部署一个从git原创 2014-04-15 09:26:54 · 849 阅读 · 0 评论 -
linux php下Ajax请求时URL路径出现重复
1. 项目用的YII框架,在module下面的Usertest.php有一个方法:public function getTextArea($fieldName,$usertest_id) { return CHtml::activeTextArea($this,$fieldName,array("name"=>$fieldName."_".$usertes原创 2015-06-03 17:27:01 · 1228 阅读 · 0 评论 -
Yii中使用PHPExcel导出Excel
1. 下载PHPExcel,放到项目的extention下面:如截图2. 在Controller里面创建方法如下,参考文章点击打开链接:/** * export all models. */ public function actionExport() {// // 第1部分:导出Excel表头设置 /* * PHPExcel类库存放在protected/原创 2015-06-02 11:14:52 · 1676 阅读 · 0 评论 -
ERROR The requested URL could not be retrieved The following error was encountered
1. 出错场景:安装wamp,但是确原创 2014-05-23 13:09:56 · 6770 阅读 · 0 评论 -
WAMP Server Localhost Shows 500 Internal Server Error
1. 出错场景,装好wamp后,也能看到localhost是正确的,结果放一个项目到www原创 2014-05-23 15:04:23 · 2123 阅读 · 0 评论 -
表单提交前点击链接和表单提交后点击链接
1. 问题:表单提交前点击链接和表单提交后点击链接,导致一个URL访问的问题:表单点击前,URL是不能访问的,表单提交后,URL就可以访问了。(CakePHP的项目)提交前的URL:http://svn.fotu-report.com/stats/stats/statExport/ 多了一个stats,导致访问出错Missing Method in StatsControllerEr原创 2014-05-21 14:13:31 · 1194 阅读 · 0 评论 -
在Chrome里js没有work,network里查看js文件时,发现乱码
1. 在Chrome里js没有work,network里查看js文件时,发现乱码。原创 2014-05-21 17:42:41 · 3225 阅读 · 2 评论 -
怎么从远程访问在自己电脑上发布的网站
1. 在万维网上访问自己主机上发布的网站时,需要修改一下端口号,我的是wamp环境,在用80端口时,发现浏览器总是自动把80去掉了。但是在远程访问我主机上的网站时,用的ip+端口号,我发现默认的端口号访问不到,报如下错误: Not Found The requested URL / was not found on this server.我在httpd.config修改#Listen 12.34原创 2014-05-21 14:50:13 · 1988 阅读 · 0 评论 -
Php环境搭建的资源链接
1. wamp server下载: http://wamp-server-wamp5.cn.uptodown.com/2. php最新版本下载:原创 2014-04-15 16:39:23 · 938 阅读 · 0 评论 -
CakePHP的conditions设置不等于查询 != <>
1. CakePHP如何给查询时添加conditions,'!='要前置,数据库sqlyuj。$statClientTypes = $this->StatClientType->find('list', array('fields'=>array('stat_clienttype_id','stat_clienttype_name'),'conditions'=>array('stat原创 2014-05-20 17:43:38 · 1676 阅读 · 0 评论 -
发现CakePHP传递到Controller时数据值是对的,但是输出SQL语句后发现那个值一直是“1”
1. 在用CakePHP+mysql完成一个项目的task时,发现一个奇怪的问题,就是同时查询的两外两个下拉列表的数据都可以查询到数据,就另外一个下拉列表查询不到数据,搞的我很郁闷。后面同事过来帮我看,发现那个字段得到的值在放入CakePHP的conditions字段里时都是3,但是到sql语句输出时却变成1了。2. Leader过来看了以后发现数据库里那个字段是Tinny。后面l原创 2014-05-20 16:35:09 · 1026 阅读 · 0 评论 -
php 数据库可以查到数据的sql语句,在代码里为什么查不到数据
环境:php5.4.16。用的wampserver,但是先前的程序是用php5.1开发d原创 2014-05-20 07:29:18 · 4943 阅读 · 1 评论 -
实现CakePHP+csv导出功能
Controller的代码:public function statExport(){$statTable = $this->request->params['named']['statTable'];if (isset($statTable)){$statProductInstanceName = $this->request->params['named']['statPr原创 2014-05-19 15:55:25 · 948 阅读 · 0 评论 -
mysql_fetch_field(): supplied argument is not a valid MySQL result resource in
php新手,遇到这个错误:Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in 把程序检查了好几遍程序都没有问题,就是一直报错,后面换了一个数据库连接的方法,就可以了。不知道其中原理。正确代码:$connect = mysql_connect("localhost"原创 2014-04-11 14:41:49 · 4942 阅读 · 0 评论 -
如何在CakePHP里面加入bootstrap
新的项目需要用CakePHP+Bootstrap,在网上找了一些比较快速的把两者结合在一起的方法,下面是ba原创 2014-04-21 17:12:28 · 1256 阅读 · 0 评论 -
Parse error: syntax error, unexpected T_FUNCTION in /home2/regentsr/public_html/app/Plugin/DebugKit/
装好CakePHP和Debugkit时,出现这个错误,Parse error: syntax error, unexpected T_FUNCTION in /home2/regentsr/public_html/app/Plugin/DebugKit/Controller/Component/ToolbarComponent.php on line 179没办法,phpb原创 2014-04-15 18:18:49 · 1517 阅读 · 0 评论 -
missing Load plugin [closed]
在为CakePHP装Debugkit时报这个错误:Error: The application is trying to load a file from the DebugKit pluginError: Make sure your plugin DebugKit is in the app\Plugin directory and was loaded原创 2014-04-15 15:07:18 · 923 阅读 · 0 评论 -
Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your a
搭建CakePHP时出现这个错误:Release Notes for CakePHP 1.3.5.Read the changelogNotice (1024): Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your application [原创 2014-04-15 14:59:40 · 1293 阅读 · 0 评论 -
Yii 添加自己的搜索条件
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('usertest_id',$thi原创 2015-06-09 10:53:34 · 1328 阅读 · 0 评论