- 已加入
- 3/22/06
- 訊息
- 618
- 互動分數
- 0
- 點數
- 16
Parse error: syntax error, unexpected T_VARIABLE in /home/sir/schoolboard/schoolboard.ini on line 17
我連到某個php3的網頁
出現這個~
而那server是我架的...
不知道為啥架不好...
作業系統是FreeBSD 6.1
用的是apache 2.2.4還2.2.3忘了...XD
mysql 5.0
php5
有裝php5-extenions
而schoolboard.ini的檔案內容是
<?
###############################################################
# Edit the following variables to suit your needs #
###############################################################
$dbhost = "XXXXXX";
$default_dbname = "schoolboard";
$dbusername = "schoolboard";
$dbuserpassword = "XXXXX";
$user_tablename = "user_table";
$attachmentdir = "/home/sir/attachment/";
$board = "school_board";
$board_title = "XXXXX"
# Look and feel
$default_font = "Times New Roman";---------------第17行在這$default_font_size = "2";
$master_table_bgcolor ="#EBEBEB";
$master_table_bordercolor ="#FFFFFF";
$header_cell_bgcolor = "#303072";
$header_cell_font_color = "#FFFFFF";
$msg_cell_bgcolor="#D8E9FE";
$msg_display_cell_bgcolor = "#F0F5FF";
$post_table_bgcolor = "#FFFFFF";
$post_cell_bgcolor = "#DDDDDD";
$post_cell_font_color = "black";
$feature_cell_bgcolor="#EBEBEB";
$menu_cell_bgcolor = "#EBEBEB";
$feature_colspan = $menu_colspan = "6";
$info_colspan = "6";
$separator = "<hr width=\"90%\" size=\"1\">";
$master_table_width = '90%';
$master_table_border = '0';
$post_table_border = '0';
$master_cellpadding = '1';
$master_cellspacing = '1';
$post_cellpadding = '1';
$post_cellspacing = '1';
$board_info_table_width = '90%';
$number_cell_width ="5%";
$subject_cell_width = "51%";
$id_cell_width = "8%";
$name_cell_width ="20%";
$hit_cell_width = "8%";
$date_cell_width = "8%";
$msg_rows = "15";
$msg_cols = "60";
$subject_length = "40";
# The maximum number of messages listed per page
$max_msg_per_page = 15;
# hspace between threaded messages
$default_hspace = 5;
# set $allowhtml to 1 (true) if you want to allow html tags
$allowhtml = 0;
$icon_dir = "icons";
$space_icon = "$icon_dir/space.gif";
$main_icon = "$icon_dir/main.gif";
$new_main_icon = "$icon_dir/main_new.gif";
$reading_icon = "$icon_dir/reading.gif";
$print_icon = "$icon_dir/print.gif";
# Who are you?
$webmaster_email = "XXX@XXX";
$webmaster_signature = "Your signature goes here.";
$webmaster_signature .= "You got more to say in your signature? It might go on and on...";
# Wanna get notified on new postings?
$maileron = 0;
function db_connect($dbname)
{
global $dbhost, $dbusername, $dbuserpassword;
mysql_connect($dbhost, $dbusername, $dbuserpassword);
mysql_select_db($dbname);
}
function error_message ($msg, $userid) {
global $webmaster_email;
switch ($msg) {
case "FIELD_MISSING" :
$msg = "有欄位未填資料";
break;
case "NO_KEYWORD" :
$msg = "缺少關鍵字";
break;
case "NO_SUCH_USER" :
$msg = "使用者帳號: $userid 不存在,請先註冊! </a>";
break;
case "PASSWORD_MISMATCH" :
$msg = "密碼錯誤";
break;
case "USERID_MISMATCH" :
$msg = "不能修改或刪除不屬於您的公告";
break;
case "CHECK_BOX" :
$msg = "先按 checkbox 再按刪除";
break;
case "NO_SUCH_BOARD" :
$msg = "school_board表格不存在";
break;
case "NO_MSG" :
$msg = "該公告不存在";
break;
case "NO_SPACE" :
$msg = "帳號或密碼不可以有空格";
break;
case "DB_ERROR" :
$error_message = mysql_error();
$msg = "資料庫有問題,請email通知管理者 <a href=\"mailto:$webmaster_email?subject=re:DB error!&body=DB error: $error_message (Error Number: $error_no)\">$webmaster_email</a><p>";
$msg .= $error_message;
break;
default :
$msg = "$msg is not a correct parameter to the error function.";
break;
}
?>
<div align="center"><center>
<table border="1" cellpadding="2" cellspacing="0" width="50%" bgcolor="#666666"
bordercolor="#FFFFFF">
<tr>
<th bgcolor="#336699" align="center" valign="top"><font color="#FFFFFF">錯誤:
</font></th>
<td bgcolor="#B4B4B4" align="center">
<center><strong><? echo $msg ?></strong></center>
</td>
</tr>
</table>
</center></div>
<?
}
function auth_user($userid, $userpassword, $groups) {
global $default_dbname, $user_tablename;
mysql_select_db($default_dbname);
$result = mysql_query("select userpassword, groups from $user_tablename where userid='$userid'");
if(!$result) {
error_message('DB_ERROR', '');
}
$query_data = mysql_fetch_row($result);
$num_row = mysql_num_rows($result);
if($num_row == 0) {
return 3;
}
if(crypt($userpassword, '.v') == $query_data[0]) {
return 1;
}
else {
return 0;
}
}
function my_br2nl ($input_text)
{
return eregi_replace ("<br>", "\n", $input_text);
}
function my_nl2br ($input_text)
{
return eregi_replace ("\n", "<br>", $input_text);
}
function mail_webmaster($board_title, $mail_body)
{
global $webmaster_email;
$mail_subject = "有新公告張貼在 $board_title .";
mail($webmaster_email, $mail_subject, $mail_body);
}
我連到某個php3的網頁
出現這個~
而那server是我架的...
不知道為啥架不好...
作業系統是FreeBSD 6.1
用的是apache 2.2.4還2.2.3忘了...XD
mysql 5.0
php5
有裝php5-extenions
而schoolboard.ini的檔案內容是
<?
###############################################################
# Edit the following variables to suit your needs #
###############################################################
$dbhost = "XXXXXX";
$default_dbname = "schoolboard";
$dbusername = "schoolboard";
$dbuserpassword = "XXXXX";
$user_tablename = "user_table";
$attachmentdir = "/home/sir/attachment/";
$board = "school_board";
$board_title = "XXXXX"
# Look and feel
$default_font = "Times New Roman";---------------第17行在這$default_font_size = "2";
$master_table_bgcolor ="#EBEBEB";
$master_table_bordercolor ="#FFFFFF";
$header_cell_bgcolor = "#303072";
$header_cell_font_color = "#FFFFFF";
$msg_cell_bgcolor="#D8E9FE";
$msg_display_cell_bgcolor = "#F0F5FF";
$post_table_bgcolor = "#FFFFFF";
$post_cell_bgcolor = "#DDDDDD";
$post_cell_font_color = "black";
$feature_cell_bgcolor="#EBEBEB";
$menu_cell_bgcolor = "#EBEBEB";
$feature_colspan = $menu_colspan = "6";
$info_colspan = "6";
$separator = "<hr width=\"90%\" size=\"1\">";
$master_table_width = '90%';
$master_table_border = '0';
$post_table_border = '0';
$master_cellpadding = '1';
$master_cellspacing = '1';
$post_cellpadding = '1';
$post_cellspacing = '1';
$board_info_table_width = '90%';
$number_cell_width ="5%";
$subject_cell_width = "51%";
$id_cell_width = "8%";
$name_cell_width ="20%";
$hit_cell_width = "8%";
$date_cell_width = "8%";
$msg_rows = "15";
$msg_cols = "60";
$subject_length = "40";
# The maximum number of messages listed per page
$max_msg_per_page = 15;
# hspace between threaded messages
$default_hspace = 5;
# set $allowhtml to 1 (true) if you want to allow html tags
$allowhtml = 0;
$icon_dir = "icons";
$space_icon = "$icon_dir/space.gif";
$main_icon = "$icon_dir/main.gif";
$new_main_icon = "$icon_dir/main_new.gif";
$reading_icon = "$icon_dir/reading.gif";
$print_icon = "$icon_dir/print.gif";
# Who are you?
$webmaster_email = "XXX@XXX";
$webmaster_signature = "Your signature goes here.";
$webmaster_signature .= "You got more to say in your signature? It might go on and on...";
# Wanna get notified on new postings?
$maileron = 0;
function db_connect($dbname)
{
global $dbhost, $dbusername, $dbuserpassword;
mysql_connect($dbhost, $dbusername, $dbuserpassword);
mysql_select_db($dbname);
}
function error_message ($msg, $userid) {
global $webmaster_email;
switch ($msg) {
case "FIELD_MISSING" :
$msg = "有欄位未填資料";
break;
case "NO_KEYWORD" :
$msg = "缺少關鍵字";
break;
case "NO_SUCH_USER" :
$msg = "使用者帳號: $userid 不存在,請先註冊! </a>";
break;
case "PASSWORD_MISMATCH" :
$msg = "密碼錯誤";
break;
case "USERID_MISMATCH" :
$msg = "不能修改或刪除不屬於您的公告";
break;
case "CHECK_BOX" :
$msg = "先按 checkbox 再按刪除";
break;
case "NO_SUCH_BOARD" :
$msg = "school_board表格不存在";
break;
case "NO_MSG" :
$msg = "該公告不存在";
break;
case "NO_SPACE" :
$msg = "帳號或密碼不可以有空格";
break;
case "DB_ERROR" :
$error_message = mysql_error();
$msg = "資料庫有問題,請email通知管理者 <a href=\"mailto:$webmaster_email?subject=re:DB error!&body=DB error: $error_message (Error Number: $error_no)\">$webmaster_email</a><p>";
$msg .= $error_message;
break;
default :
$msg = "$msg is not a correct parameter to the error function.";
break;
}
?>
<div align="center"><center>
<table border="1" cellpadding="2" cellspacing="0" width="50%" bgcolor="#666666"
bordercolor="#FFFFFF">
<tr>
<th bgcolor="#336699" align="center" valign="top"><font color="#FFFFFF">錯誤:
</font></th>
<td bgcolor="#B4B4B4" align="center">
<center><strong><? echo $msg ?></strong></center>
</td>
</tr>
</table>
</center></div>
<?
}
function auth_user($userid, $userpassword, $groups) {
global $default_dbname, $user_tablename;
mysql_select_db($default_dbname);
$result = mysql_query("select userpassword, groups from $user_tablename where userid='$userid'");
if(!$result) {
error_message('DB_ERROR', '');
}
$query_data = mysql_fetch_row($result);
$num_row = mysql_num_rows($result);
if($num_row == 0) {
return 3;
}
if(crypt($userpassword, '.v') == $query_data[0]) {
return 1;
}
else {
return 0;
}
}
function my_br2nl ($input_text)
{
return eregi_replace ("<br>", "\n", $input_text);
}
function my_nl2br ($input_text)
{
return eregi_replace ("\n", "<br>", $input_text);
}
function mail_webmaster($board_title, $mail_body)
{
global $webmaster_email;
$mail_subject = "有新公告張貼在 $board_title .";
mail($webmaster_email, $mail_subject, $mail_body);
}
最後編輯: