22:56
PHP4与PHP3中一个不兼容问题的解决方法,PHP4与PHP3中有些不兼容的地方,但这主要是PHP4中的PHP.ini中的设置有些不同的地方,这些改变主要是提高PHP4的效率。其中的改变中,track_vars的设置通常会是使旧的PHP3程序不能再运行了,因为在PHP4的扩展设置中把track_vars的值设为了off这样旧的PHP3程序中就不能直接..
22:56
全文搜索和替换,lt;?phpnbsp;nbsp;execquot;/bin/grep-r'$oldword'$rootpathquot;,$results,$errorCode;nbsp;nbsp;if$errorCode{nbsp;nbsp;if$errorCode==1{nbsp;nbsp;echoquot;Possiblynofileswerefoundwith$oldwordinthemlt;BRgt;\nquot;;nbsp;nbsp;}nbsp;nbsp;echoquot;OSEr
22:56
教你如何把一篇文章按要求分段,lt;?php$a=quot;这是一个小段落.看吧quot;;$a.=quot;这又是小句!quot;;$a.=quot;最后一句?quot;;$a.=quot;这是结果了!quot;;//其实这是一个长的字句。$b=splitquot;[\.\!\?]quot;,$a,4;//根本句号,!号,问号等按自己的要求分段for$index=0;$indexlt;count$b;$index++..
22:56
一个用于mysql的数据库抽象层函数库,lt;?php////SourceForge:BreakingDowntheBarrierstoOpenSourceDevelopment//Copyright1999-2000cTheSourceForgeCrew//http://sourceforge.net////$Id:database.php,v1.62000/04/1114:17:13cvsExp$/////etc/local.incincludesthemachinespecificdata
22:56
一个高ai的分页函数和一个url函数,这个分页函数非常高只能的看看就知道了functionppage$total,$page,$e_page=15,$e_block=10,$url='',$color=''{if!strpos$url,'?'nbsp;nbsp;nbsp;$url.='?';elsenbsp;nbsp;nbsp;$url.='amp;';if$colorlt;gt;''{nbsp;nbsp;nbsp;$colornbsp;nbsp;nbsp;='lt;fontcolor='.$c
22:56
用函数读出数据表内容放入二维数组,//用函数读出数据表内容放入二维数组//动态sql语句//以读出点击次数表为例。functionlist_hit$fields,$where,$order,$direction,$limit,$conn{if$fields==quot;quot;{$fields=quot;hit_id,banner_id,hit_ip,hit_timequot;;}if$order==quot;quot;{$direction=quot;quot;..
22:56
Email+URL的判断和自动转换函数,lt;?phpfunctionvalidateEmail$emailnbsp;nbsp;{nbsp;nbsp;nbsp;nbsp;nbsp;returneregiquot;^[_a-z0-9-]+\.[_a-z0-9-]+*@[a-z0-9-]+\.[a-z0-9-]+*\.[a-z]{2,3}$quot;,$email;nbsp;nbsp;}nbsp;nbsp;functionvalidateURL$urlnbsp;nbsp;{nbsp;nbsp;nbs
22:56
用PHP调用数据库的存贮过程!,用PHP调用数据库的存贮过程!作者:fox4000昨天,看到一个战友问是否可以用php调用存贮过程,感觉应该是可以的,所以,马上进行了实验,非常的成功!非常出乎我的意料之外!因此,写出来,给大家参考!大家知道,存储过程是在服务器端的一个脚本程序,执行起来速度很快..
22:56
给多个地址发邮件的类,lt;?phpnbsp;nbsp;////////////////////////////////////////////////////////////nbsp;nbsp;//nbsp;nbsp;nbsp;EmailClass0.5nbsp;nbsp;//nbsp;nbsp;nbsp;classforsendingmailnbsp;nbsp;//nbsp;nbsp;//nbsp;nbsp;nbsp;PaulSchreibernbsp;nbsp;//nbsp;nbsp;nb
22:56
如何将数据从文本导入到mysql,access中可以将文本中的数据轻松导入表中,mysql中用起来没那么方便,其实起来也很简单。首先将数据记录按行处理好用特定的字符分开如:“,”记录形如:aaa,bbb,ccc,ddd,eeefff,ggg,hhh,iii,jjj,kkk就行,建立loaddate.phplt;?phpnbsp;nbsp;$hostname=quot;localhostquo..
22:56
用PHP+java实现自动新闻滚动窗口,show.php源代码:lt;?if$action==quot;cpquot;{echoquot;lt;divalign=centergt;nbsp;nbsp;lt;pgt;滚动菜单资料输入端lt;/pgt;nbsp;nbsp;lt;formmethod=postaction=show.php?action=editgt;nbsp;nbsp;nbsp;nbsp;lt;pgt;文字一:nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nb
22:56
一个连接两个不同MYSQL数据库的PHP程序,lt;HTMLgt;lt;BODYBGCOLOR=FFFFFFgt;nbsp;nbsp;lt;?phpnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;echoquot;Connectingasmysqllt;BRgt;\nquot;;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;$connection1=mysql_connect'localhost','mysql',''ordie$php_errormsg;nbsp;nb
22:56
NTIIS下用ODBC连接数据库,$connection=intodbc_connectstringdsn,stringuser,stringpassword建立数据库连接,$query_string=quot;查询记录的条件quot;如:$query_string=quot;select*fromtablequot;用$cur=intodbc_execintconnection_id,stringquery_string检索数据库,将记录集放入$cur变量中。..
22:56
数据库的日期格式转换,只要在convert中指定日期格式的代号就够了,如:selectconvertchar20,getdate,101selectemp_id,convertchar20,hire_dt,101fromemployee-----------------------------------------------------日期格式nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;代号----------..
22:56
PHP中动态HTML的输出技术,你可以在php程序中的任何地方使用echoquot;helloworld!quot;;来输出你想输出的内容。不过你将遇到以下麻烦:1-当你试图在hello和world之间加入两个(或两个以上)空格,你使用:echoquot;helloworld!quot;;你得到的输出还是一个空格,或者你在行首加入一个空格,你的空..
22:56
在字符串中把网址改成超级链接,$string=quot;连接http://www.phpx.com站点quot;;//连接后需要有个空格或回车。$string=nbsp;nbsp;eregi_replacequot;http://[^,\r\n]*quot;,quot;lt;ahref=\\0target=_blankgt;\\0lt;/agt;quot;,$string;$string=nbsp;nbsp;eregi_replacequot;ftp://[^,\r\n]*quot;,qu..
22:56
Php做的端口嗅探器--可以指定网站和端口,lt;?nbsp;nbsp;//Php做的端口嗅探器--可以指定网站和端口//并返回嗅探结果nbsp;nbsp;nbsp;nbsp;functionhttp_request$server,$port{nbsp;nbsp;nbsp;nbsp;$data=quot;quot;;nbsp;nbsp;nbsp;nbsp;$query=quot;HEAD/HTTP/1.0quot;;nbsp;nbsp;nbsp;nbsp;$fp=fsockopen$serv..
22:56
通过文字传递创建的图形按钮,通过文字传递创建的图形按钮,详细说明请看文内英文说明lt;?phpHeaderquot;Content-type:image/gifquot;;//infoforthebrowsernbsp;nbsp;nbsp;nbsp;/*PHP3Buttongenerator,c2000byIzzySoftizzysoft@buntspecht.denbsp;nbsp;nbsp;nbsp;*License:GPLanditwouldbenicetodrop..
22:56
屏蔽浏览器缓存另类方法,有时候我们不希望浏览器使用缓存加快网页的显示,尤其是那些论坛之类的频繁更新内容的网页,在网上有说可以使用下面的方法来屏蔽缓存,但是我试了效果不好。nbsp;nbsp;lt;METAHTTP-EQUIV=quot;Pragmaquot;CONTENT=quot;no-cachequot;gt;nbsp;nbsp;某日我突发奇想,找到..
22:56
一个SQL管理员的web接口,lt;?nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/*************************************************************************************nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;*nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;SQLAdminnbsp;nbsp;v2.0nbsp;nbsp;-n
22:56
php访问查询mysql数据的三种方法,1.$row=mysql_fetch_row$result;返回一个规则的数组$row,$row[0]是第一个元素,$row[1]是第二个元素,依次类推...mysql_num_fields$result返回结果的元素个数。2.$row=mysql_fetch_array$result;返回一个数组$row.举例如下:表结构如下:username|password----------------..
22:56
二十行语句实现从Excel到mysql的转化,自从对php和mysql有了一定的了解之后,我就对公司里庞大的Excel数据库虎视眈眈,想偷偷地quot;共享quot;这被保密的商业数据,一边琢磨着怎么搞到手,一边考虑如何转化成mysql数据库,去了很多php站点论坛请教高手,都没有一个结果,某天突发想象,为何不试试这种方法呢..
22:56
模拟SQLSERVER的两个函数:dateadd,datediff,lt;?php//文件名:date.inc.php3//在使用这两个函数前,要先将日期或日期时间转换成timestamp类型。//如://$today=mktime0,0,0,datequot;mquot;,datequot;dquot;,datequot;Yquot;;/****模拟sqlserver中的dateadd函数*******$part类型:string取值范围:year,month,day..
22:56
定制404错误页面,并发信给管理员的程序,如果您的用户找不到他要的页面,如何给他一个友好的答复,并且你也知道发生了这个错误呢,看看下面这段程序,是用来定制404错误页面和发通知给网管的好东西。---teaman翻译整理lt;?php#设置$domain为你的域名注意没有www$domain=quot;oso.com.cnquot;;#设置URL,注意没有..
22:56
树型结构列出指定目录里所有文件的PHP类,lt;?//以树型结构列出指定目录里的所有文件,如果你想知道自己某个目录里有哪些子目录和文件,可以调用这个类来查看,很方便的。nbsp;nbsp;nbsp;nbsp;#演示的例子:nbsp;nbsp;nbsp;nbsp;$t=newTreeClimberquot;aspquot;;//新建物件,设置需要列出的目录:在此为asp目录nbs..
22:56
使用字符串函数输出整数化的PHP版本号,再用用程序时,一般需要对php版本号整数化后进行判断,从而确定输出。lt;?php$temp=explodequot;.quot;,phpversion;//以数组形式获取版本号$num=count$temp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;//计算数组中的元素数量$phpve..
22:56
利用window_onload实现select默认选择,请参考这个程序:lt;?php//$day星期几,如:星期三$day=3;?gt;lt;htmlgt;lt;headgt;lt;metahttp-equiv=quot;Content-Typequot;content=quot;text/html;charset=gb2312quot;gt;lt;metaname=quot;GENERATORquot;content=quot;MicrosoftFrontPage4.0quot;gt;lt;
22:56
如何删除多级目录,昨天看见一个贴子chinaasp问怎么删除目录,以前一直可以,但昨天出了问题,原来他只是把他下级的文件删了后就删目录所以如果多几级就有问题。我的这个只能暂时凑活着用,如果你的目录没有十几层的话应该没有问题的吧~,但我不熟悉递归只能做到deltree$path;rmdir$path才..
22:56
生成sessionid和随机密码的例子,用这个可以来验证用户和生成随机密码--teamanlt;?nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;//----------------------------------------------------nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;//FunctionGetSIDnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;//nbsp;nbsp
22:56
php生成EXCEL的东东,可以通过PHP来产生EXCEL档.nbsp;nbsp;teaman翻译----------------------------ExcelFunctions----------------------------将下面的代码存为excel.php,然后在页面中包括进来然后调用1.CallxlsBOFnbsp;nbsp;2.将一些内容写入到xlswritenunber或者xlswritelabel中.3.然后..