易截截图软件、单文件、免安装、纯绿色、仅160KB

php模板技术

站点结构

代码:
站点
  ┗includes
       ┗class.inc
  ┣templet
       ┗index.htm
       ┣list.htm
       ┗content.htm
  ┣index.php
  ┗content.php
库结构

代码:
-- 数据库: `test`
-- 表的结构 `test`
CREATE TABLE `test` (
  `id` smallint(3) NOT NULL auto_increment,
  `name` varchar(10) NOT NULL default '',
  `sex` enum('男','女') NOT NULL default '男',
  `age` smallint(2) NOT NULL default '0',
  `email` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
--------------- class.inc文件 --------
CODE:
<?
php 
 
class 
mycon
{  
    private 
$myhost

    private 
$myuser

    private 
$mypwd

    function 
mycon
(
$host
=
"localhost"
,
$user
=
"root"
,
$pwd
=
""
){ 
      
$this
->
myhost 

$host

      
$this
->
myuser 

$user

      
$this
->
mypwd 

$pwd

    } 
    function 
connect
(){ 
      return 
mysql_connect
(
$this
->
myhost
,
$this
->
myuser
,
$this
->
mypwd
); 
    } 
  } 

  class 
templet

     private 
$source_file

     function 
get_file
(
$filename
){ 
         
$


相关文档:

PHP中基于MVC模式的小型项目总结

最近做了几个小型的项目,比较简单,只是需要细心,都可以完成,主要是对MVC模式的熟练应用,对WEB类开发还是很有帮助的。
刚开始的第一个小项目,用来练手,然后我全部是流程化的编程。代码也就400行左右。结果我的导师,觉得代码结构不清晰,不容易
维护,需要修改。需要我采用OO类的编程方式进行改写。我以前写PHP,几 ......

php soap


原文转自 :http://home.phpchina.com/space.php?uid=49655&do=blog&id=182488
一. 必备知识
1.wsdl(web服务标记语言)
       WSDL(网络服务描述语言,Web Services Description Language)是一门基于 XML
的语言,用于描述 Web Services 以及如何对它们进行访问。
  ......

PHP通过gettext实现多语言国际化支持

之前PHP实现多语言国际化,大部分都会采用把语言直接提出来作为数组来调用,例如比较有名phpMyadmin,discuz等知名开源系统,不过,这里介绍如何通过gettext,即用资源文件来实现。典型的CMS案例-wordpress也是通过它实现的语言国际化,下面来说下php中如何来利用配置文件实现国际化的。
首先介绍下.MO文件,在PHP中是利用 ......

PHP用邮件取回忘记密码功能?

wangjimima.php
<form id="form1" name="form1" method="post" action="mailto.php" onSubmit="return CheckForm()">
<input name="username" type="text" class="in" id="username" size="30" onmouseover="fEvent('mouseover',this)" onfocus="fEvent('focus',this)" onblur="fEvent('blur',this)" onmouseout ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号