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
){
$
相关文档:
最近做了几个小型的项目,比较简单,只是需要细心,都可以完成,主要是对MVC模式的熟练应用,对WEB类开发还是很有帮助的。
刚开始的第一个小项目,用来练手,然后我全部是流程化的编程。代码也就400行左右。结果我的导师,觉得代码结构不清晰,不容易
维护,需要修改。需要我采用OO类的编程方式进行改写。我以前写PHP,几 ......
isset() 【1】
Returns TRUE if var
exists and has value other
than NULL, FALSE otherwise.
输入可以是多个变量,只有所有的变量为真的时候,返回真
empty()【2】
Returns FALSE if var
has a non-empty
and non-zero value.
The following things are considered to be empty:
"" (an em ......
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 ......
源码目录:/usr/local/src/
应用目录:/usr/local/app/
一、MYSQL安装。
1.下载MSYQL源码:
http://www.mysql.com/downloads/mysql/
最近版本是 mysql-5.1.47.tar.gz
2.上传到服务器目录/usr/local/src/
cd /usr/local/src/
tar zxvf mysql-5.1.47.tar.gz
cd mysql-5.1.47
./configure --prefi ......