升级PHP后,程序无法使用(寻求帮助)
我在 centos 5.2 上安装了 php-5.2.6安装后,有一个PHP程序无法使用。之前这个PHP程序是,在网页打开的时候,会系统弹出一个输入用户名和密码的验证框,用户名和密码存储在mysql 中,但现在是使用正确的用户名和密码都无法登陆这个程序。寻求高人指点啊。以下是我安装的一些步骤:
rpm -ivh perl-DBI-1.56-1.noarch.rpm
rpm -ivh MySQL-shared-compat-5.1.25-0.rhel5.i386.rpm
rpm -ivh perl-DBD-MySQL-3.0007-1.fc6.i386.rpm
rpm -ivh unixODBC-2.2.11-7.1.i386.rpm
rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm
./configure --prefix=/usr/local/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc --enable-inline-optimization --with-zlib --with-gd --with-ttf --with-gmp --with-pcre-dir=/usr/local/bin/pcre-config --with-mysql=/usr/local/mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/local/mysql/bin/mysql_config --disable-debug --enable-posix --disable-rpath --enable-safe-mode --enable-magic-quotes --disable-dmalloc --enable-bcmath --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-exif --enable-ftp --enable-sockets --enable-wddx --with-jpeg-dir --with-freetype-dir --enable-gd-native-ttf --with-mime-magic=/usr/share/file/magic.mime
============================== 程序验证密码部分的 PHP 代码 ===================
function authenticate($security_level=false) {
if(!MSEE) {
$user = $_SERVER['PHP_AUTH_USER'];
$pass = $_SERVER['PHP_AUTH_PW'];
$sql = sprintf("SELECT fullname, type FROM users WHERE username=%s AND password=%s", quote_smart($user), quote_smart(md5($pass)));
$sth = dbquery($sql);
$result = mysql_fetch_row($sth);
if (isset($user) && isset($pass) && mysql_num_rows($sth) > 0) {
$GLOBALS['full_name'] = $result[0];
$GLOBALS['user_type'] = $result[1];
if($security_level) {
if($GLOBALS['user_type'] <> $security_level) {
html_start("Not authorised");
echo "<TABLE CLASS=\"BOXTABLE\" WIDTH=100%><TR><TD><H1><FONT COLOR=\"RED\">Not Authorised</FONT></H1>Your are not authorised to view this page!.</TD></TR>\n";
html_end();
exit;
}
}
[ 本帖最后由 疯狂老头 于 2008-7-11 10:11 编辑 ]