php学习笔记(12):PHP+MYSQL留言板(上
require() 与 require_once()
通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 require
所指定引入的文件,如果出现错误是致命的。
nclude() 与 include_once()
可以放在 PHP 程序的任何一个位置,PHP 程序在执行到时,才会先读入
include 所指定引入的文件,如果出现错误将会提示。
require('con.php') ;
include('con.php') ;
PHP5在默认的情况下接收参数是需要使用
$_GET['value'];
$_POST['value'];
还可以在PHP.ini 文件中的
将register_globals = Off
改register_globals = on
可以直接使用,$value的值
con.php //数据库配置
add.php //操作文件
list.php //列表文件
俗话说:源码面前无秘密,下面我们来看源代码:
add.php:
<?php
/*
* Created on 2010-1-4
* Author:CHAVUET
* Function:留言板
*/
?>
<script type="text/javascript">
function ClearInputs(){
document.myform[0].value="";
document.myform[1].value="";
document.myform[2].value="请输入您的留言内容";
}
</script>
<form name="myform" action="conn.php" method="post">
<table align="center" style="margin-top:200px">
<tr>
<td>留言人:<input type="text" name="user" size="10"/></td>
</tr>
<tr>
<td>标 题:<input type="text" name="title" size="14"/></td>
</tr>
<tr>
<td>内 容:<textarea name="content">请输入您的留言内容</textarea></td>
</tr>
<tr>
<td><input type="submit" name
相关文档:
相信很多的朋友对使用iBatis管理数据库很不习惯,因为我们要手写代码,特别是dynamic
query部分更是不知如何嵌套,而这些是可以用工具的!下面介绍一种最常用的!不废话了,直接上配置过程!
1、获得 http://ibatis.apache.org/abator.html
Eclipse可以自动的进行Update获取此Plugin ......
MySQL 5.1 是 MySQL 数据库目前发布的最新的稳定版本(5.5是beta状态,6.0是alpha状态)。
该版本增加了对下面几个平台的支持:
Mac OS X 10.6 x86/x64
HP-UX 11.31 IA64
SLES 11 x86/x64
InnoDB 插件升级到 1.0.6 版本,另外通过对查询缓存的碎片优化提升了性能,更多详细的内容请看这里。
下载地址:http://dev. ......
一直习惯使用小写的SQL保留字,没想到今天居然遇到了麻烦哈!!和谐一下MYSQL啦!
环境:Server version: 5.1.37-1ubuntu5 (Ubuntu)
alter table child_table_name
add constraint constraint_name
foreign key (column_1)
references reference_table_name(reference_column_1);
和
ALTER TABLE child_t ......
1.
Download Apache for windows MSI
file, and run it
By
default, port is 80, root dir is %apache_dir%/htdocs. You can update the
settings in conf/httpd.conf file
2. If Apache Service can't be installed in "Control Panel > Admin Tools > Services&quo ......