Copy CodeThe code is as follows: /*********************************************
*
* Program Name: PHP Enthusiasts message Board
* Demo: http://www.phpfans.net/guestbook/
*
* Author: I am not a fish
* email:deng5765@163.com
* Website: http://www.phpfans.net
* Blog: http://www.phpfans.net/space/?2
* Version: v1.0
* Help: http://www.phpfans.net/guestbook/
*********************************************/
if (Isset ($_post[' Submit ')) {
$mydbuser = $_post[' m_root ');
$MYDBPW = $_post[' M_PW ');
$mydbname = $_post[' m_db ');
if (! @mysql_connect ("localhost", $mydbuser, $MYDBPW)) {
echo "MySQL username or password is incorrect." Returns the modification.
Return ";
Exit
}
mysql_query ("Set names ' GBK '");
$dbsql = "CREATE DATABASE IF not EXISTS". $mydbname;
if (! @mysql_query ($dbsql)) {echo "Please check if you have permission to build the database"; exit;}
echo "CREATE database {$mydbname} success >>
";
mysql_select_db ($mydbname);
$char = ";
if (Mysql_get_server_info () > ' 4.1 ') $char = ' DEFAULT charset=gbk ';
$sql = "CREATE TABLE ' post ' (
' p_id ' int (255) unsigned not NULL auto_increment,
' p_name ' varchar (not NULL),
' P_email ' varchar (not NULL),
' P_QQ ' varchar (not NULL),
' p_homepage ' varchar (+) not NULL,
' P_image ' varchar (8) Not NULL,
' p_title ' varchar is not NULL,
' P_content ' Mediumtext not NULL,
' p_ip ' varchar (not NULL),
' P_date ' datetime not NULL,
PRIMARY KEY (' p_id ')
) Engine=myisam {$char}; ";
if (! @mysql_query ($sql)) {echo "Please check if the data sheet post exists, please delete it first."; Exit;}
echo "Create data sheet Post success >>
";
$sql = "INSERT into ' post ' VALUES (1, ' I'm not fish ', ' deng5765@163.com ', ' 245821218 ', ' http://www.phpfans.net ', ' 01 ', ' Thank you for using PHP hobby Message board ', '
Thank you very much for your support of the PHP fan message board.
If you encounter any problems with your application, please go to
http://www.phpfans.net/guestbook/Get Help
or make your suggestions. Welcome to PHP enthusiasts Station
Http://www.phpfans.net
', ' 127.0.0.1 ', Now ()) ";
if (@mysql_query ($sql)) {echo "Initialize data table successfully
";}
$sql = "CREATE TABLE ' reply ' (
' r_id ' int (255) unsigned not NULL auto_increment,
' p_id ' int (255) is not NULL,
' r_content ' varchar (255) is not NULL,
' r_rname ' varchar (not NULL),
' R_time ' date not NULL,
PRIMARY KEY (' r_id '),
UNIQUE KEY ' p_id ' (' p_id ')
) Engine=myisam {$char}; ";
if (! @mysql_query ($sql)) {echo "Please check if the data table reply exists, please delete it first."; Exit;}
echo "Create data Sheet Reply Success >>
";
$str = ' $str. = ' $mydbhost = \ ' localhost\ '. "; /database server \ n ";
$str. = ' $mydbuser = \ '. $mydbuser. "'; /database user name \ n ";
$str. = ' $MYDBPW = \ '. $mydbpw. "'; /Database password \ n ";
$str. = ' $mydbname = \ '. $mydbname. "'; /database name \ n ";
$str. = ' $mydbcharset = \ ' Gbk\ '. "; /database encoding, no modification is recommended. \ n ";
$str. = ' $admin = \ '. $_post[' m_admin '). ' \ ';//Administrator name '. " \ n ";
$str. = ' $ADMINPW = \ '. $_post[' M_ADMINPW '). ' \ ';//Administrator password '. " \ n ";
$str. = ' $eachpage = 5;//The number of message bars per page '. \ n ";
$str. = '?> ';
$fp = fopen (' include/config.php ', ' W ');
if (! $fp) {echo ' This space does not support the file function, please manually configure the contents on config.php
";}
else{
Fwrite ($fp, $STR);
Fclose ($FP);
echo "Configuration document config.php Update successful >>
";
echo "Installation completed successfully. To be safe, remove insall.php
";
}
Echo '
Enter the message board home ';
Exit
}
?>
<title>PHP Enthusiasts Message Board installation</title>
http://www.bkjia.com/PHPjc/317616.html www.bkjia.com true http://www.bkjia.com/PHPjc/317616.html techarticle Copy the code as follows: PHP/********************************************* * * Program name: PHP Enthusiasts Message Board * Demo: http://www.phpfans.net/ guestbook/* * Author: I am not a fish ...