php获取来源页面

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

php学习--时间函数及时区设置

评论(0)浏览(130)分类:PHP/apache/Perl
php学习--时间函数及时区设置date(string format[,int timestamp])format可以使用的格式代码代码 描述a   上午或下午,两个小写字符表示,”am“或“pm”A   同上,只是用大写表示,“AM”或“PM”B   swatch internet时间,不常用c   ISO 8601。日期用YYYY-MM-DD表示,时间用HH:MM:SS。如【2004-03-26T21:04:42+11:00】,用T分隔日期和时间,后面的+表示当地..

php学习--使用COM

评论(0)浏览(127)分类:PHP/apache/Perl
php学习--使用COM示例代码点击这里下载生成excel电子表格+展开-PHP?phpinclude_once("guid.php");$ex=newCOM("Excel.sheet")ordie("Can'tnotopenexcel!");//$ex-Application-Visible=1;$wkb=$ex->application->workbooks->add();$sheet=1;excel_write_cell($wkb,$sheet,"A4","Hello,World!");$exFileName=realpath(".")."\\".getGuid().".xls";$wkb->SaveAs($exF..

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

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

php学习--auth授权

评论(0)浏览(122)分类:PHP/apache/Perl
php学习--auth授权+展开-PHP$auth=false;$user=$_SERVER['PHP_AUTH_USER'];$pwd=$_SERVER['PHP_AUTH_PW'];if(isset($user)&&isset($pwd)&&$user==strrev($pwd))$auth=true;if(!$auth){header('www-authenticate:basicrealm="topsecretfiles"');header("http/1.0401unauthorized");}echo$user,"",$pwd;

php学习--net类库函数

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

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

评论(0)浏览(116)分类: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()..

phpmyadmin Cannot start session without errors

评论(0)浏览(116)分类: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..

php学习--生成guid

评论(0)浏览(106)分类:PHP/apache/Perl
php学习--生成guid+展开-PHPclassSystem{functioncurrentTimeMillis(){list($usec,$sec)=explode("",microtime());return$sec.substr($usec,2,3);}}classNetAddress{var$Name='localhost';var$IP='127.0.0.1';functiongetLocalHost(){$address=newNetAddress();$address->Name=$_ENV["COMPUTERNAME"];$address->IP=$_ENV['SERVER_ADDR'];return$address;}function..

php学习--mysql基础知识

评论(0)浏览(98)分类: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学习--自定义错误处理

评论(0)浏览(95)分类: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=..

php学习--html字符替换

评论(0)浏览(82)分类: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..