随笔分类 - PHP
Discuz7使用syntaxhighlighter_2.0.320实现代码高亮
摘要:Discuz7使用syntaxhighlighter_2.0.320实现代码高亮一、修改./templates/default/discuzcode.htm文件在function tpl_codedisp($discuzcodes, $code) 函数前增加如下函数function tpl_codecsh($discuzcodes, $code, $lang) {}–><!–{block return}–><code id="code$discuzcodes[codecount]"><pre class="brush: $lan
阅读全文
FCKeditor 上传
摘要:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>FCKeditor上传</title><scripttype="text/javascript"src="
阅读全文
工厂方法模型之PHP实现
摘要:<?php/***@意图:工厂方法模型,定义一个用于创建对象的接口,让子类决定实例化哪一个类。FactoryMethod使一个类的实例化延迟到其子类*@适用性:*1、当一个类不知道它所必须创建的对象的类的时候*2、当一个类希望由它的子类来指定它所创建的对象的时候*3、当类创建对象的职责委托给多个帮助子类中的某一个,并且你希望将那一个帮助子类是代理者这一信息局部化的时候*@author:王康*@copyright:http://blog.csdn.net/wkjs*/?><?php/***@name:*@uses:Page*@version:1.0.0*@author:王康*@
阅读全文
PHP验证码
摘要:<?phpHeader("Content-type: image/PNG"); //初始化$border = 1; //是否要边框 1要:0不要$how = 5; //验证码位数$w = $how*13; //图片宽度$h = 20; //图片高度$fontsize = 5; //字体大小$array="0123456789"; //随机字符$seccode = ""; //验证码字符串初始化srand((double)microtime()*1000000); //初始化随机数种子$im = ImageCreate($w, $
阅读全文
PHP创建文件
摘要:<?php//创建文件夹function createFolders($path){ //递归创建 if (!file_exists($path))//如果文件夹不存在 { createFolders(dirname($path));//取得最后一个文件夹的全路径返回开始的地方 mkdir($path, 0777); }}//创建并写文件function createFile($filename,$content){ createFolders($filename);//创建文件夹 file_put_contents($filename,$content);//写文件 chmod($fi
阅读全文
基于Apache URL Rewrite的静态化网页(.htaccess)
摘要:1、 修改文件:Apache2.X.X\conf\httpd.conf找到这一行# LoadModule rewrite_module modules/mod_rewrite.so将前面的#删除2、 查找所有的AllowOverride,将后面的none修改为ALL<Directory /> Options FollowSymLinks AllowOverride ALL //就是这一行 Order deny,allow Allow from all Satisfy all</Directory>3、 重新启动Apache4、 再配上针对于你的程序设计的.htacces
阅读全文
PHP Wap程序配置
摘要:Wap服务器配置1、 修改Apache的httpd.conf文件,增加如下内容。 AddType application/x-httpd-php .wml AddType text/vnd.wap.wml .wml;charset=gb2312 AddType image/vnd.wap.wbmp .wbmp AddType application/vnd.wap.wmlc .wmlc AddType text/vnd.wap.wmlscript .wmls AddType application/vnd.wap.wmlscriptc .wmlsc。 AddType application/j
阅读全文
Basic Syntax基本语法
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>{{$Name}}</title></head> <body> {{*首先显示模板数据,然后使用函
阅读全文
Smarty功能扩展
摘要:<?php //Smarty_extends.class.php require_once('includes/smarty/Smarty.class.php'); //包含smarty类文件 /** * class Smarty_extends * * Description for class Smarty_extends * * @author:王康 */ class Smarty_extends extends Smarty{ /** * Smarty_extends constructor * * @param */ function Smarty_extend
阅读全文
Smarty模板使用
摘要:<?php $template_name = 'TemplateDemo'; //模版文件夹名 require_once('includes/smarty/Smarty.class.php'); //包含smarty类文件 $smarty=new Smarty; //初始化Smarty $smarty->compile_check = true; //打开模版编译检查 $smarty->debugging = false; //关闭调试 $smarty->caching = false; //关闭缓存 $smarty->templa
阅读全文
nusoap 中文乱码 C# 调用
摘要:<?phprequire_once('../lib/nusoap.php');$server = new soap_server();$server->soap_defencoding='UTF-8';$server->decode_utf8=false;$server->configureWSDL('Service1');$server->register('Welcome',array('name' => 'xsd:string'),array('re
阅读全文
PHP语言入门
摘要:PHP语言入门2.1 PHP语言基础 2.1.1 PHP文件格式 Helloworld.php<Html> <head> <title>Hello World!</title> </head> <body> <?php //输出Hello,World echo "Hello,World"; ?> </body></html> 2.1.2 PHP标记 <?php……?> <?……?> <script language=”php”>……
阅读全文
浙公网安备 33010602011771号