挑战最棒的留言本的源码(四)_PHP

WBOY
Release: 2016-06-01 12:29:11
Original
722 people have browsed it

config.php文件

// 你的用户名和密码,以及数据库名,和表名,在这里一次定义!!!
// 由于怕用户名和密码被别人通过浏览器看到,所以用了php的扩展名,这样通过浏览就看不到了!!!.

$username='your_name'; //用户名
$password='your_password'; //密码

$hostname='localhost'; //主机名,一般都为localhost

$db_name='your_db_name'; //数据库名
$table_name='your_liuyan_table'; //存放留言的表名

$table_name_control='your_control_table'; //控制表名

$number_records_to_display=5; //每页显示的留言条数!


$hang_zifu_number=50; //换行的一行字符数!



// 连接数据库,在这里连好!!!

$id_link=@mysql_connect($hostname,$username,$password);
if (! $id_link) {
affy_message("The connection to the local dtabase has failed.");}

// 处理参数,以后所有参数都可以通过 $arr_request['name']得到,不管是post的还是get的!!!

$arr_request=array();
if (count($HTTP_GET_VARS)) {
while (list($key,$value)=each($HTTP_GET_VARS)) {
$arr_request[strtolower($key)]=$value;
}
}

if (count($HTTP_POST_VARS)) {
while (list($key,$value)=each($HTTP_POST_VARS)) {
$arr_request[strtolower($key)]=$value;
}
}

// 一些出错处理函数!

function affy_footer() {
echo '

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template