From 1b35fdfb8aa65b8a89b080f88417fb7c1addadad Mon Sep 17 00:00:00 2001
From: ry1015 Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . " Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . " \nPassword has been changed!. Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . " Deposit completed. Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . " Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . " Connection error. Please try again later. Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . " Unable to connect to the database server. Error code " . mysql_errno() . ": " . mysql_error() . "Username
Max Limit
- Checking Balance
+ Balance
+ Account Type
_END;
increaseLimit();
diff --git a/f8l_exception/change_password.php b/f8l_exception/change_password.php
index 3d15bde..36db1f8 100644
--- a/f8l_exception/change_password.php
+++ b/f8l_exception/change_password.php
@@ -21,9 +21,17 @@ include 'includes/inc_validateLogin.php';
function changePassword($userName,$oldPassword,$newPassword) {
global $errorCount;
- include 'includes/inc_dbConnect.php';
+ global $connection;
+
+ //include 'includes/inc_dbConnect.php';
// Select database.
+ if ($connection->connect_error)
+ echo "
\n";
- include 'includes/inc_text_menu.php';
+ //include 'includes/inc_text_menu.php';
}
?>
diff --git a/f8l_exception/deposit.php b/f8l_exception/deposit.php
index 1594d6f..d2d161f 100644
--- a/f8l_exception/deposit.php
+++ b/f8l_exception/deposit.php
@@ -19,9 +19,31 @@ include 'includes/inc_validateLogin.php';
function deposit($userName,$accountId,$amount) {
global $errorCount;
global $errorMessage;
- include 'includes/inc_dbConnect.php';
+ global $connection;
+ //include 'includes/inc_dbConnect.php';
// Select database.
+ if ($connection->connect_error)
+ echo "
";
+ }
+ }
+ /*
if ($db_connect === FALSE) {
$errorMessage .= " ";
+ "" . $row['username'] . " $ " . number_format($row['maxlimit'], 2, '.', ',') .
- " $ " . number_format($row['balance']) . " $ " . number_format($row['balance'], 2, '.', ',') . " " . $row['acctype'] . " ";
}
}
?>
\ No newline at end of file
diff --git a/f8l_exception/includes/inc_getNumberOfAccounts.php b/f8l_exception/includes/inc_getNumberOfAccounts.php
index b5fb213..12d2112 100644
--- a/f8l_exception/includes/inc_getNumberOfAccounts.php
+++ b/f8l_exception/includes/inc_getNumberOfAccounts.php
@@ -1,18 +1,18 @@
num_rows;
- mysql_close($db_connect);
+ //mysql_close($db_connect);
return $count;
}
diff --git a/f8l_exception/includes/inc_header.php b/f8l_exception/includes/inc_header.php
index 81d628c..ccee37d 100644
--- a/f8l_exception/includes/inc_header.php
+++ b/f8l_exception/includes/inc_header.php
@@ -10,7 +10,7 @@ if (isset($_SESSION['login'])){
} else {
$loggedin = FALSE;
}
-$loggedin = FALSE;
+//$loggedin = FALSE;
if ($loggedin){
include 'includes/inc_loggedin_text_menu.php';
} else {
diff --git a/f8l_exception/includes/inc_validateUserName.php b/f8l_exception/includes/inc_validateUserName.php
index 23dbfdd..ad685b4 100644
--- a/f8l_exception/includes/inc_validateUserName.php
+++ b/f8l_exception/includes/inc_validateUserName.php
@@ -16,32 +16,21 @@ function validateUserName($data, $fieldName)
}
else {
- include 'includes/inc_dbConnect.php';
- // Select database.
- if ($db_connect === FALSE)
- echo "
\n";
- $errorMessage .= "Please select a different User Name.
\n";
- $errorCount++;
- $retval = "";
- }
- else {
- $retval = trim($data);
- $retval = stripslashes($retval);
- }
- }
- mysql_close($db_connect);
- }
+ // Select database.
+ $result = queryMysql("SELECT * FROM users WHERE username = '$data'");
+ $num = $result->num_rows;
+
+ if ($num > 0){
+ $errorMessage .= "Please select a different User Name.
\n";
+ $errorCount++;
+ $retval = "";
+ } else {
+ $retval = trim($data);
+ $retval = stripslashes($retval);
+ }
+
+ $result->close();
}
return ($retval);
}
diff --git a/f8l_exception/login.php b/f8l_exception/login.php
index 17ac8f7..5670b5e 100644
--- a/f8l_exception/login.php
+++ b/f8l_exception/login.php
@@ -1,5 +1,3 @@
-
+
";
- $SQLstring = "INSERT INTO account (username,balance,accounttype)
+ $SQLstring = "INSERT INTO account (username,balance,acctype)
VALUES ('$userName','$balance','$accountType')";
$QueryResult = @mysql_query($SQLstring, $db_connect);
@@ -40,6 +47,8 @@ function openNewAccount($userName,$balance,$accountType) {
mysql_close($db_connect);
}
return ($retval);
+ *
+ */
}
function displayForm() {
diff --git a/f8l_exception/new_customer.php b/f8l_exception/new_customer.php
index a72f73e..5b2cc2c 100644
--- a/f8l_exception/new_customer.php
+++ b/f8l_exception/new_customer.php
@@ -15,6 +15,7 @@
Register a New Customer
Unable to connect to the database server.
Error code " . mysql_errno() . ": " . mysql_error() . "
"; - - else { - if (!@mysql_select_db($db_name, $db_connect)) - echo "Connection error. Please try again later.
"; - else { - $SQLstring = "INSERT INTO - user (username,password,email) - VALUES ('$userName','$pw','$email')"; - - $QueryResult = @mysql_query($SQLstring, $db_connect); - } - mysql_close($db_connect); - } - return ($retval); + $result = queryMysql("INSERT INTO + users (username,password,email) + VALUES ('$userName','$pw','$email')"); } function displayForm($userName,$email) { @@ -103,8 +90,9 @@ else { $message = "You have successfully registered as a new customer for F8L Exception Online Bank. We hope you will enjoy our service and our lack of fees!\n\nThe F8L Exception Online Bank"; // message lines should not exceed 70 characters (PHP rule), so wrap it $message = wordwrap($message, 70); + // send mail - mail($email,$subject,$message,"From: $from\n"); + //mail($email,$subject,$message,"From: $from\n"); echo "You have been set up as a new customer. Welcome to F8L Exception Online Bank!.
Unable to connect to the database server.
" . "Error code " . mysql_errno() . ": " . mysql_error() . "
"; - $errorCount++; - } - else { - if (!@mysql_select_db($db_name, $db_connect)) { - $errorMessage .= "Connection error. Please try again later.
"; - $errorCount++; - } - else { - // verify the account belongs to the user - $sql = "SELECT * FROM account WHERE username='$userName' and accountid='$fromAccountId'"; - $result = mysql_query($sql); + if ($connection->connect_error){ + echo "Unable to connect to the database server.
" . "Error code " . mysql_errno() . ": " . mysql_error() . "
"; + $errorCount++; + } else { + // verify the account belongs to the user + $query = "SELECT * FROM account WHERE username='$userName' and accID='$fromAccountId'"; + $result = queryMysql($query); - // If result matched $myusername and $accountId, table rows must be 1 row - $count = mysql_num_rows($result); - if($count == 1){ - // record transfer to both accounts - $sql2 = "UPDATE account SET balance=balance-'$amount' WHERE username='$userName' and accountid='$fromAccountId'"; - $result = mysql_query($sql2); - $sql3 = "UPDATE account SET balance=balance+'$amount' WHERE accountid='$toAccountId'"; - $result = mysql_query($sql3); - $errorMessage .= "Transfer completed.
"; - } - else { - $errorCount++; - $errorMessage .= "Invalid user name/account number.Transfer completed.
"; + } + else { + $errorCount++; + $errorMessage .= "Invalid user name/account number.Error code " . mysql_errno() . ": " . mysql_error() . "
"; - - else { - if (!@mysql_select_db($db_name, $db_connect)) - echo "No data found.
"; - else { - - $TableName = "document"; - $SQLstring = "SELECT * FROM $TableName WHERE login = '$Login' and active = 1"; - - $QueryResult = @mysql_query($SQLstring, $db_connect); - if (mysql_num_rows($QueryResult) == 0) - echo "No data found .
"; - else - { - echo "| Title | -Tags | -Revised Date | -Note1 | -Edit | -Remove | -{$Row['title']} | "; - echo "{$Row['tags']} | "; - echo "{$Row['revisedDate']} | "; - echo "{$Row['note1']} | "; - ?> -- - | -- - |
|---|
| Title | +Tags | +Revised Date | +Note1 | +Edit | +Remove | +{$Row['title']} | "; + echo "{$Row['tags']} | "; + echo "{$Row['revisedDate']} | "; + echo "{$Row['note1']} | "; + ?> ++ + | ++ + |
|---|