php根据访问者ip地址获取天气预报信息

评论(2)浏览(257)分类:PHP/apache/Perl
php根据访问者ip地址获取天气预报信息今天有空了,将根据访问用户IP地址自动获取天气预报下载中捉去sina天气数据的php代码更新了,如下所示header(content-type,text/html;charset=gb2312);ini_set('date.timezone','PRC');//设置时间为中国时区function removeHTML($str){$str=preg_replace(/[^]+/,,$str);return $str;}function getip(){ $ip =$_SERVER[http_x_f..

wordpress路径包含中文乱码404找不到内容解决办法

评论(0)浏览(395)分类:PHP/apache/Perl
wordpress路径包含中文乱码404找不到内容解决办法  WordPress重写路径中包含中文时会提示找不到内容,重写路径中的中文显示乱码解决办法。  最近在window系统配置WordPress,发现如果postname包含中文时,会提示找不到内容的错误,英文的postname则没有问题。  环境:window2003+fastcgi,网站编码utf-8。  经过调试再读取数据文件wp-includes\query.php中echo输出post_name为乱码,经过..

iis6,iis7+ wordpress路径重写配置/%postname%/配置

评论(0)浏览(299)分类:PHP/apache/Perl
iis6,iis7+ wordpress路径重写配置/%postname%/配置  最近在window2003、window7下安装了WordPress,将自己发现的额问题和如何解决总结一下。当配置WordPress固定链接设置为下面这种结构时,注意需要配置iis6,iis7+增加通配符隐射到你使用的framework版本aspnet_isapi.dll上才行,要不会出现404错误,找不文件。http://域名/%postname%/  window2003使用的是fastcgi搭建的php运行环境(参考:..

File upload error - unable to create a temporary file in Unknown on line 0

评论(0)浏览(233)分类:PHP/apache/Perl
File upload error - unable to create a temporary file in Unknown on line 0  php文件上传时提示File upload error - unable to create a temporary file in Unknown on line 0错误(系统环境:window2003+IIS6+FastCGI+PHP5.3.4),出现这个错误是因为php上传的文件先保存到临时目录中,然后再从临时目录拷贝到目标目录去,如果临时目录没有网站用户写入权限就会报错。  不是搞php,不懂php默认上传路径在哪里(有人..

The FastCGI Handler was unable to process the request Error Number: 5 (0x80070005)

评论(0)浏览(136)分类:PHP/apache/Perl
The FastCGI Handler was unable to process the request Error Number: 5 (0x80070005)2015-12-18更新:如果你服务器安装过网站安全狗,记得一定要将php-cgi.exe加入白名单中,这个错误是由于网站安全狗拦截造成的。也有可能由于php.ini配置不正确,导致模块加载不成功,也会报fastcgi错误。参考:php startup:unable to load dynamic library找不到指定的模块  今天使用微软的FastCGI来搭建php在windows2003+IIS6下的运行环境,出..

php realpath,file_exists文件存在却返回false解决办法

评论(0)浏览(427)分类:PHP/apache/Perl
php realpath,file_exists文件存在却返回false解决办法  昨天下载的php网站配招运行环境进行安装时(系统环境:window2003+IIS6+FastCGI+PHP5.3.4),一直无法正常运行,一直提示程序已经安装,要删除lock文件。查看网站根目录下的index.php代码,里面有如下代码if(!file_exists('install/lock')){ //下面2句自己加的,输出路径echo '-'.realpath('install/lock').'-&..

php startup:unable to load dynamic library找不到指定的模块

评论(0)浏览(577)分类:PHP/apache/Perl
php startup:unable to load dynamic library找不到指定的模块  昨天配置一台服务器php运行环境时出现php startup:unable to load dynamic library找不到指定的模块的错误。  查看了php模块ext视乎路径是对的,怎么会找不到模块呢。网上找了半天,也按照步骤操作了还是出现找不到模块的错误。   我操。。结果原来是拷贝了电脑上的php到服务器上时,路径搞错了,服务器路径是D:\WAPM\PHP,本地电脑上的..

设置X-Frame-Options响应头防止网页被框架

评论(0)浏览(5598)分类:Asp/VBScript
设置X-Frame-Options响应头防止网页被框架  防止某些重要网页被其他网站框架导入,可以给页面增加X-Frame-Options响应头,这样浏览器会依据X-Frame-Options的值来控制iframe框架的页面是否允许加载显示出来,IE下的效果如下(此内容无法再框架中显示。为了帮助保护在此网站中输入的信息安全,此内容的发行者不允许在框架中显示该信息),其他非IE核心浏览器会显示空白内容。  动态页..

php实现javascipt charCodeAt/fromCharCode方法

评论(0)浏览(337)分类:PHP/apache/Perl
php实现javascipt charCodeAt/fromCharCode方法  php实现javascipt charCodeAt方法function charCodeAt($str, $index){ $char = mb_substr($str, $index, 1, 'UTF-8'); if (mb_check_encoding($char, 'UTF-8')) { $ret = mb_convert_encoding($char, 'UTF-32BE', 'UTF-8'); return hexdec(bin2hex($ret)); } else { ..

asp,asp.net和php如何添加301跳转

评论(0)浏览(146)分类:Asp.Net/C#/WCF
asp,asp.net和php如何添加301跳转  asp添加301跳转响应头Response.Status = 301 Moved PermanentlyResponse.AddHeader location, http://yourdomain  asp.net添加301跳转响应头Response.StatusCode = 301;Response.Status = 301 Moved Permanently;Response.AddHeader(location, http://yourdomain);   php加301跳转响应头header('HTTP/1.1 301 Moved Permanently'..

修改wordpress域名配置的3种方法

评论(0)浏览(1734)分类:PHP/apache/Perl
修改wordpress域名配置的3种方法  今天安装wordpress插件UpdraftPlus后,用UpdraftPlus还原备份导致数据中的wordpress的域名配置被备份文件中替换了,导致无法登陆wordpress管理后台,自动跳转到备份文件中的域名。  下面有3种方法可以重新设置wordpress的域名一、在可以登陆后台的情况下  使用正确的域名登陆到你的Wordpress后台(http://你的域名/wp-admin/)后,在设置..

phpmyadmin Cannot start session without errors

评论(0)浏览(115)分类:PHP/apache/Perl
phpmyadmin Cannot start session without errors  window2003+IIS搭建好php运行环境后访问phpmyadmin系统,出现错误phpMyAdmin - ErrorCannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.  出现这个错误一般是php用于保存sess..

FastCGI Error Number: 193 (0x800700c1)

评论(0)浏览(396)分类:PHP/apache/Perl
FastCGI Error Number: 193 (0x800700c1)  windows2003系统+IIS6,访问php文件报错FastCGI ErrorThe FastCGI Handler was unable to process the request.Error Details:Error Number: 193 (0x800700c1).Error Description: Unknown ErrorHTTP Error 500 - Server Error.Internet Information Services (IIS)  网上找了下说是PHP5.5开始,已不支持xp和win2003上运行了。win2003上只..

织梦后台打开空白解决办法

评论(0)浏览(157)分类:PHP/apache/Perl
织梦后台打开空白解决办法  最近研究织梦cms,在window2003系统+IIS下搭建好了织梦系统php的运行环境。做了些许修改后,过段时间(大概是iis程序池空闲时间自动退出),打开浏览器再访问织梦cms管理后,发现是空白的,什么内容都没有。用firebug看返回的内容有2个乱码字符串,但是页面上并没有显示这些乱码内容,空白一片。  跟踪程序执行后发现执行到验证用户信息,..

php同一个浏览器共用session并发挂起

评论(0)浏览(280)分类:PHP/apache/Perl
php同一个浏览器共用session并发挂起  php在同一个浏览器下,session的会话id是一样的,当同时请求2个页面,这2个页面都使用了session(调用session_start()),那么最后一个到达服务器的请求将被挂起,直到先到达服务器的php页面执行完毕后才会继续执行下一个php请求。  这个和asp/asp.net的会话加锁机制一样,并发请求时使用session后续到达的session会被挂起。asp.net/asp网..

php获取来源页面

评论(0)浏览(131)分类:PHP/apache/Perl
php获取来源页面php获取来源页面很简单,使用$_SERVER获取服务器端变量就行+展开-PHP$source=$_SERVER["HTTP_REFERER"];echo$source;

php隐形字符65279

评论(0)浏览(668)分类:PHP/apache/Perl
php隐形字符65279  今天在CSDN看到一个php输出空白隐形字符65279的问题,在网上找了下,发下这个65279字符是php用来标记文件是utf-8编码的,输出的时候会一起输出到客户端,导致客户端如果使用ajax得到返回值时,无法匹配字符串。  php隐形字符65279解释如下UTF-8 编码的文件可以分为无 BOM 和 BOM 两种格式。何谓BOM?  "EF BB BF" 这三个字节就叫BOM,全..

Cookie在IE浏览器跨域不能存储读取解决方案

评论(0)浏览(193)分类:Asp.Net/C#/WCF
Cookie在IE浏览器跨域不能存储读取解决方案最近在做一个Banner切换的功能,用coolie存储切换到的Banner位置,用script标签来加载生成Banner的页面。由于平时用Firefox调试JavaScript,所以测试的时候还是使用Firefox,结果正确,按循序切换。当换IE浏览器来查看效果的时候,发现IE只能显示第一个Banner,不能按循序切换。发现跨域生成的cookie被IE浏览器给拦截了,晕。。。后面网上查找了..

Apache NameVirtualHost *:80 has no VirtualHosts

评论(0)浏览(238)分类:PHP/apache/Perl
Apache NameVirtualHost *:80 has no VirtualHosts 相关文章Windows7 + Apache + MySql5 + PHP5 + PhpMyAdmin 安装与环境配置Apache2.2提示Cannot load php5apache2_2.dll into server apache-conf-Invalid command 'PHPIniDir', perhaps misspelled解决方案apache Could not reliably determine the server‘s fully qualified domain nameApache NameVirtualHost *:80 has no VirtualHosts Apac..

apache Could not reliably determine the server‘s fully qualified domain name

评论(0)浏览(223)分类:PHP/apache/Perl
apache Could not reliably determine the server‘s fully qualified domain name相关文章Windows7 + Apache + MySql5 + PHP5 + PhpMyAdmin 安装与环境配置Apache2.2提示Cannot load php5apache2_2.dll into server apache-conf-Invalid command 'PHPIniDir', perhaps misspelled解决方案apache Could not reliably determine the server‘s fully qualified domain nameApache NameVirtualHost *:80 has no VirtualHosts   ..

Apache2.2提示Cannot load php5apache2_2.dll into server

评论(0)浏览(144)分类:PHP/apache/Perl
Apache2.2提示Cannot load php5apache2_2.dll into server 相关文章Windows7 + Apache + MySql5 + PHP5 + PhpMyAdmin 安装与环境配置Apache2.2提示Cannot load php5apache2_2.dll into server apache-conf-Invalid command 'PHPIniDir', perhaps misspelled解决方案apache Could not reliably determine the server‘s fully qualified domain nameApache NameVirtualHost *:80 has no VirtualHosts 先说..

Firefox访问apache网站默认文档出现保存对话框

评论(0)浏览(122)分类:PHP/apache/Perl
Firefox访问apache网站默认文档出现保存对话框Firefox访问网站默认文档出现保存对话框今天在按照网上的资料配置apache的时候,可能有些地方没有配置对,当用Firefox访问http://localhost的时候,返回的默认文档类型为“application/x-httpd-php”,Firefox无法打开这种文件,只能保存。用其他浏览器也出现这种情况。后面进行了修改后,其他浏览器通过http://localhost已经能访问到默认文档了..

php学习--net类库函数

评论(0)浏览(118)分类:PHP/apache/Perl
php学习--net类库函数file_get_contents($url);//返回指定的web页面的所有内容在php中,文件函数可以完成许多操作。对于某些http或https任务,可能需要curl库,通过curl库可以登陆到一个web站点并且在一些页面中模拟用户的操作使用网络查找函数$url=parse_url("url"):该函数返回包含url不同部分的相关数组,该数组的可用信息部分分别是“模式”,“用户”,“传递”..

php学习--操作mysql及mysql基础知识

评论(0)浏览(143)分类:PHP/apache/Perl
php学习--操作mysql及mysql基础知识PHP连接MYSQL数据库MYSQL数据库知识show tables:查看数据库中表的清单--------------------------------------------------------------------------------show databases:查看数据库系统中所有数据库的清单--------------------------------------------------------------------------------describe 表名称:查看数据库表的相信信息-------..

php学习--mysql基础知识

评论(0)浏览(96)分类:PHP/apache/Perl
php学习--mysql基础知识在字符'表示方法,mssql用''代表一个',而mysql可以使用''或者\'代表一个'set类型:可以包含最多64项,如果插入不属于set集合中的值时会自动去处;如果插入了重复的值时也会自动去掉重复项EG: create table data(fieldSet set('A','B'));insert into data values('c'); ==则插入的为空,应为不在set('A','B')中insert into data values('A,A,B..

php学习--简单的IO读写操作实现记录功能

评论(0)浏览(105)分类:PHP/apache/Perl
php学习--简单的IO读写操作实现记录功能log.php+展开-PHP?phpclasslog{var$filename,$fp;functionlog($filename){$this->filename=$filename;$this->open();}functionopen(){$this->fp=fopen($this->filename,"a")ordie("Can'topen{$this->filename}!");}functionwrite($note){fwrite($this->fp,"$note\n");}functionread(){returnjoin('',file($this->filename));}function__wakeup()..

php学习--IO操作

评论(0)浏览(133)分类:PHP/apache/Perl
php学习--IO操作fopen("路径","模式")//模式--ab:追加写,2进制 r:只读fgets==fread//读fgetss,fgetssv,是上面读的变体fgetc,一次读一个字符fputs==fwrite//写php 5+file_put_contents//不用打开文件就可以写file_get_contents;//不用打开文件就可以读,返回类型为字符串状态判断feof(文件指针变量)//判断是否到达底部//读整个文件的内容readfile,fpassthru..

php学习--html字符替换

评论(0)浏览(79)分类:PHP/apache/Perl
php学习--html字符替换+展开-PHPfunctionHTMLEncode($str){$str=str_replace("\r","",$str);$str=str_replace("\"","",$str);$str=str_replace(">","",$str);$str=str_replace("","",$str);$str=str_replace("'","'",$str);$str=str_replace("\n","br/>",$str);return$str;}functionHTMLDecode($str){$str=str_replace("","\"",$str);$str=str_replace("",">",$st..

php学习--图像处理

评论(0)浏览(141)分类:PHP/apache/Perl
php学习--图像处理生成png图片代码+展开-PHP$img=imagecreate(200,200);$white=imagecolorallocate($img,0xff,0xff,0xff);$black=imagecolorallocate($img,0x00,0x00,0x00);//imagepolygon($im,array(10,100,30,400,50,600),3,$black);//imagearc($im,100,100,200,150,0,270,$black);//imagefilledrectangle($im,0,0,200,200,$black);imagestring($img,5,50,160,"..

php学习--自定义错误处理

评论(0)浏览(93)分类:PHP/apache/Perl
php学习--自定义错误处理+展开-PHP?php/*//所有错误的基类ExceptionclassException{protected$message="Unknownexception",$code=0,$file,$line,$trace,$string;function__construct(string$message=null,int$code=0){if(func_num_args())$this-message=$message;$this-code=$code;$this-file=__FILE__;//ofthrowclause$this-line=__LINE__;//ofthrowclause$this-trace=..