1 頁 (共 1 頁)

[問題]防止大量註冊程式有錯誤訊息

發表於 : 2004-02-01 17:04
kaoht
架設主機作業系統:RedHat 9
您的上網方式:ADSL ISP=gigigaga
您安裝的程式:Apache + php + MySql
您的 phpBB2 版本:phpBB (2.0.6)。
您的 domain(網域名稱) :mail.gotonat.com.tw
您的 phpBB2 連結網址: http://mail.gotonat.com.tw/phpBB2/
錯誤代碼:請使用 BBcode 標籤將錯誤代碼標註,範例如下(這是為了避免語法衝突): Parse error: parse error, unexpected '{', expecting ')' in /var/www/html/phpBB2/includes/usercp_register.php on line 897

發表於 : 2004-02-01 17:05
aiken
Parse error: parse error, unexpected '{', expecting ')' in /var/www/html/phpBB2/includes/usercp_register.php on line 897
看一下前後10行的內容有沒有改錯

發表於 : 2004-02-01 18:10
kaoht
Parse error: parse error, unexpected T_STRING in /var/www/html/phpBB2/includes/usercp_register.php on line 1060

現在我出現是關於資料庫的問題

發表於 : 2004-02-01 18:49
Mac
kaoht 寫:Parse error: parse error, unexpected T_STRING in /var/www/html/phpBB2/includes/usercp_register.php on line 1060

現在我出現是關於資料庫的問題
這種 error 多數表示你少了(或多了) "," / ";"

~Mac

發表於 : 2004-02-01 19:16
kaoht
是不是我沒有資料讓程式是尋找\r
才會產生此狀況

發表於 : 2004-02-01 19:45
Mac
不是,是你的 usercp_register.php 第 1060 行有程式寫作上的問題,也就是上一篇我提到的 - 少了(或多了) "," / ";"

如果你還是找不到問題在哪裡,把第 1060 行前後 10 行貼出來吧\r

~Mac

發表於 : 2004-02-01 21:33
kaoht
Mac 對不起\r
因為這是我第一次發表問題,如有不當請見諒!
if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
}
}
}
else
{
$template->assign_block_vars('switch_validation', array() );
}
#
CREATE TABLE phpbb_anti_robotic_reg (
session_id char(32) DEFAULT '' NOT NULL,
reg_key char(5) NOT NULL,
timestamp int(11) unsigned NOT NULL,
PRIMARY KEY (session_id));

copy antirobot_pic.php to antirobot_pic.php

copy images/anti_robotic_reg/anti_robotic_reg_*.gif to images/anti_robotic_reg/
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

發表於 : 2004-02-02 03:04
Mac
kaoht,你貼的是什麼啊?我是說 usercp_register.php 的第 1060 行前後 10 行耶\r

~Mac

發表於 : 2004-02-03 09:40
kaoht
Mac 對不起
因為這是我第一次發表問題,如有不當請見諒!
if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
}
}
}
else
{
$template->assign_block_vars('switch_validation', array() );
}
#
\nCREATE TABLE phpbb_anti_robotic_reg (
session_id char(32) DEFAULT '' NOT NULL,
reg_key char(5) NOT NULL,
timestamp int(11) unsigned NOT NULL,
PRIMARY KEY (session_id));

copy antirobot_pic.php to antirobot_pic.php

copy images/anti_robotic_reg/anti_robotic_reg_*.gif to images/anti_robotic_reg/
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

發表於 : 2004-02-03 17:01
Mac

代碼: 選擇全部

CREATE TABLE phpbb_anti_robotic_reg ( 
session_id char(32) DEFAULT '' NOT NULL, 
reg_key char(5) NOT NULL, 
timestamp int(11) unsigned NOT NULL, 
PRIMARY KEY (session_id)); 
這個不是要你寫在程式你面的,這是要在資料庫理執行的(或用 phpmyadmin)

代碼: 選擇全部

copy antirobot_pic.php to antirobot_pic.php 

copy images/anti_robotic_reg/anti_robotic_reg_*.gif to images/anti_robotic_reg/
這個是要你把檔案複製到正確的目錄夾 @@

~Mac

發表於 : 2004-02-03 22:04
kaoht
Mac 大大你好\r
我用phpmyadmin 執行了資料庫程式後
Table 'phpbb_anti_robotic_reg' already exists

程式執行出現以下狀況
Could not delete validation key

DEBUG MODE

SQL Error : 1146 Table 'phpBB2.phpbbanti_robotic_reg' doesn't exist

DELETE FROM phpbbanti_robotic_reg WHERE timestamp < '1075812833' OR session_id = '7bd5fbcf9d9964b8034a25a6a5fe1deb'

Line : 894
File : /var/www/html/phpBB2/includes/usercp_register.php
請問我的SQL是否有資料表有錯..
紅色是我的894行

'LANGUAGE_SELECT' => language_select($user_lang, 'language'),
'STYLE_SELECT' => style_select($user_style, 'style'),
'TIMEZONE_SELECT' => tz_select($user_timezone, 'timezone'),
'DATE_FORMAT' => $user_dateformat,
'HTML_STATUS' => $html_status,
'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => $smilies_status,

'L_CURRENT_PASSWORD' => $lang['Current_password'],
'L_NEW_PASSWORD' => ( $mode == 'register' ) ? $lang['Password'] : $lang['New_password'],
'L_CONFIRM_PASSWORD' => $lang['Confirm_password'],
'L_CONFIRM_PASSWORD_EXPLAIN' => ( $mode == 'editprofile' ) ? $lang['Confirm_password_explain'] : '',
'L_PASSWORD_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_if_changed'] : '',
'L_PASSWORD_CONFIRM_IF_CHANGED' => ( $mode == 'editprofile' ) ? $lang['password_confirm_if_changed'] : '',
'L_SUBMIT' => $lang['Submit'],
'L_RESET' => $lang['Reset'],
'L_ICQ_NUMBER' => $lang['ICQ'],
'L_MESSENGER' => $lang['MSNM'],
'L_YAHOO' => $lang['YIM'],
'L_WEBSITE' => $lang['Website'],
'L_AIM' => $lang['AIM'],
'L_LOCATION' => $lang['Location'],
'L_OCCUPATION' => $lang['Occupation'],