【PHP 实用代码收集】教程文章相关的互联网学习教程文章

PHP自动生成月历代码

<?php/* Function Written by Nelson Neoh @3/2004. For those who wants to utilize this code, please do not remove this remark. If you have done any enhancement to this code, please post the copy at http://www.dev-club.com PHP board. Thank you.Function usage: calendar(Month,Year)*/function calendar($MM,$YYYY){ if($MM=="") $MM = date("m"); if($YYYY=="") $YYYY = date("Y"); if(checkdate($MM...

论坛头像随机变换代码

论坛头像随机变换代码1.将 <?readfile(rand(0,2)..gif);?> 写字板存为yourname.php文件 2.命名要使用的头像图片分别为0.gif 1.gif 2.gif 3.php文件和图片上传到支持php的空间 4.在论坛个人设置的头像栏填入http://www.yourdomain.com/../yourname.php?.gif 5.OK

如何限制访问者的ip(PHPBB的代码)

如何限制访问者的ip(PHPBB的代码)Code: <?php/**************************************************************************** admin_user_ban.php* -------------------* begin : Tuesday, Jul 31, 2001* copyright : (C) 2001 The phpBB Group* email : [email]support@phpbb.com[/email]** $Id: admin_user_ban.php,v 1.21.2.2 2002/05/12 15:57:45 psotfx Exp $***********************************************************...

PHP_Flame(Version:Progress)的原代码

IPHP_Flame (Version: Progress ) 的一些信息: *修正了无法下载文件的BUG *修正了无法返回上级的BUG *修正了代码编辑出现错误的BUG ...... *增加PHPINFO的功能 *增加多文件下载的功能 *增加执行系统命令的功能 *增加代码查看功能 *增加服务器安全探测功能 ....... *还有许多美化工作。。。。。。 相关的资料: 1。修正了无法返回上级的BUG的代码: echo "<a href=\"$php_self?act=dir&dir=$dir\..\">返回上级</a>"; 2。修正了无法...

图形数字验证代码

图形数字验证代码Code: <?/** Filename: authpage.php*/srand((double)microtime()*1000000);//验证用户输入是否和验证码一致if(isset($_POST['authinput'])){if(strcmp($_POST['authnum'],$_POST['authinput'])==0)echo "验证成功!";elseecho "验证失败!";}//生成新的四位整数验证码while(($authnum=rand()%10000)<1000);?><form action=authpage.php method=post><table>请输入验证码:<input type=text name=authinput style...

PHP树的代码,可以嵌套任意层

PHP树的代码,可以嵌套任意层<?file://建立树的主要函数,传递的参数为根节点的编号和根节点的标题function create_tree($rootid,$roottilte){ print_parent_from_rootsortid($rootid,$roottilte);}file://打印根节点div头的函数function print_parent_from_rootsortid($rootid,$roottilte){ $parent_fullname="R".$rootid."Parent"; file://div 父级区别标志 $parent_id="R".$rootid; $parent_pic="R".$ro...

高亮度显示php源代码

高亮度显示php源代码<?phpfunction HeighPHPcode($Heightstring){ do{ $z=0; if(preg_match('/<phpcode>(.*?)</phpcode>/s',$Heightstring,$reg)) { $z=1; $code=''; ob_start(); highlight_string($reg[1]); $code = ob_get_contents(); ob_end_clean(); $reg[1] = addslashes($reg[1]); $Heightstring=preg_replace("/<phpcode>(.*?)</phpcode>/s","$code",$Heightstring,1); ...

php代码优化及php相关问题总结

1,在函数中,传递数组时使用 return 比使用 global 要高效比如function userloginfo($usertemp){$detail=explode("|",$usertemp);return $detail;}$login=userloginfo($userdb);比function userloginfo($usertemp){global $detail;$detail=explode("|",$usertemp);}userloginfo($userdb); 要高效2,(这个代码用于得到程序目录对应的网址,推荐使用)$urlarray=explode(/,$HTTP_SERVER_VARS[REQUEST_URI]);$urlcount=count($urlarray);u...

域名查询代码公布

域名查询代码公布 <?php // 网络技术主管座右铭:三人行,其必有我师焉。http://www.ctohome.com // 这个代码可以是说是非常的SMART,我改动了小小部分使它更容易用。 $moreinfolist = array( // 储存WHOIS查询主机的连接方法 'at' => 'www.ripe.net/cgi-bin/whois?query=', 'au' => 'www.aunic.net/cgi-bin/whois.aunic?', 'bm' => 'www.bermudanic.bm/cgi-bin/BermudaNIC/rwhois_query_get.pl?query_text=', 'ch' =>...

一段php加密解密的代码

<?php $key = "This is supposed to be a secret key !!!"; function keyED($txt,$encrypt_key) { $encrypt_key = md5($encrypt_key); $ctr=0; $tmp = ""; for ($i=0;$i<strlen($txt);$i++) { if ($ctr==strlen($encrypt_key)) $ctr=0; $tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1); $ctr++; } return $tmp; } function encrypt($txt,$key) { srand((double)microtime()*1000000); $encrypt_key = m...

我的论坛源代码(三)

显示主题内容页面。 <HTML> <HEAD> <TITLE>狐网论坛</TITLE> <STYLE type=text/css> P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} </STYLE> <LINK href="js/cpcw.css" rel=stylesheet /LINK> <?php include "linkfox.inc.php"; include "info.inc.php"; ?> </HEAD> <body bgcolor="#FFFFFF" text="#000000" id=all> <? $query="select * from foxbb...

我的论坛源代码(四)

POST.PHP发布主题的页面,发布的信息提交到OKEY.PHP中去处理。 <html> <head> <title>论坛发帖</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <STYLE type=text/css> P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} </STYLE> <? include "linkfox.inc.php"; include "info.inc.php"; ?> <LINK href="js/cpcw.css" re...

我的论坛源代码(二)

主界面,也就是显示主题列表的这页。 //foxbbs.php 功能:显示论坛的主题 <HTML> <HEAD> <TITLE>狐网论坛</TITLE> <STYLE type=text/css> P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} </STYLE> <LINK href="js/lfox.css" rel=stylesheet /LINK> <?php include "linkfox.inc.php"; include "info.inc.php"; ?> </HEAD> <body bgcolor="#FFFFFF"> <?...

我的论坛源代码(一)

其实写这几篇代码的时间不过近三天而已,事前即没有经过详细思考和计划(可以说一点计划都没有)那天想起做个论坛试试,于是就做起来了,而我也是才接触了将近一个月时间的PHP,以前也没真正写过程序之类的东东,在写这段代码的两天半时间里,有好几次遇到困难,都想放弃,但是我还是写出来了,而且没想到居然能用,所以中间可能有很多隐患也说不清,虽然说是可以用了。 再过两天,我就要去上班,也没时间再仔细地从头到尾检查这些...

我的论坛源代码(六)

repal.php回复用的页面,因为回复可以不必要是用户,所以没加用户身份校验 <html> <head> <title>回复论题:<? echo $zt;?></title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <STYLE type=text/css> P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt} </STYLE> <LINK href="js/cpcw.css" rel=stylesheet /LINK> <?php incl...