大佬 寫:應該是可以,我的想法是利用phpbb的會員系統,然後你網站的那個作為鏡像
我的網站也能和phpbb的系統連接起來,一組登入名稱/密碼通全站!~
[php]<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect : " . mysql_error());
mysql_select_db("cybtfdb") or die("Could not select database");
$query = "select user_password from phpbb_users where username = '" . $u . "' limit 1"; // $u 是前一版登入的會員名稱\r
/* Performing SQL query */
$result = mysql_query($query) or die("Query failed : " . mysql_error());
/* Printing results in HTML */
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
foreach ($line as $col_value) {
$pw = $col_value;
}
}
$pp = md5($p); // $p是前一版登入的密碼\r
if ($pw == md5($p)){
$auth = true;
} else {
$auth = false;
}
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>[/php]
[php]<?php
if ($auth) {
...............
}
?>[/php]
希望幫到您