Home > Article > Backend Development > Challenge the best guestbook source code (4)_PHP tutorial
config.php file
// Your username and password, as well as database name, and table name, are defined here at once!!!
// Because of fear of username and password It was seen by others through the browser, so I used the php extension so that it can’t be seen through browsing!!!.
$username='your_name'; //Username
$password= 'your_password'; $hostname=' 🎜> $ table_name='your_liuyan_table'; //The name of the table where messages are stored
$table_name_control='your_control_table'; //The name of the control table
$number_records_to_display=5; //The message strip displayed on each page Count!
$hang_zifu_number=50; //The number of characters in a new line!
// Connect to the database, connect here!!!
$id_link=@mysql_connect($hostname,$username,$password);
if (! $id_link) {
affy_message("The connection to the local dtabase has failed.");}
// Processing parameters, all parameters in the future can be obtained through $arr_request['name'], whether it is post or 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;
}
}
// Some error handling functions!
function affy_footer() {
echo '
< ;/html>';
}
function affy_header($title) {
echo '
'; echo "$msg"; echo ' |