我正在尝试使一个已加密并关闭的旧脚本重新焕发生机,但我不是 php 方面的佼佼者,但熟能生巧。
我刚刚对其进行了解码并通过了安装过程,我得到了 PHP Notices Undefined 变量。
[21-Sep-2013 17:51:56 Europe/Berlin] PHP Notice: Undefined variable: dberror in C:\xampp\htdocs\install\step1.php on line 7
[21-Sep-2013 17:51:56 Europe/Berlin] PHP Notice: Undefined variable: dberror in C:\xampp\htdocs\install\step1.php on line 10
<?php
if (isset($setdb)) {
if (( ( ( $dbhost && $dbuser ) && $dbpass ) && $dbname )) {
( @mysql_connect( $dbhost, $dbuser, $dbpass ) || $dberror = 'Can\'t connect to database server' );
if (!$dberror) {
( @mysql_select_db( $dbname ) || $dberror = 'Can\'t select database' );
if (!$dberror) {
@session_register( 'dbhost' );
@session_register( 'dbuser' );
@session_register( 'dbpass' );
@session_register( 'dbname' );
$_SESSION['dbhost'] = $dbhost;
$_SESSION['dbuser'] = $dbuser;
$_SESSION['dbpass'] = $dbpass;
$_SESSION['dbname'] = $dbname;
print '<script> window.location=\'index.php?menu=step2\'; </script>';
}
}
}
else {
$dberror = 'All fields are required';
}
}
有人可以告诉我有什么问题吗。