次の問題があります: if ($_POST['Submitted'] == "true") { この行は未定義のエラーを生成し続けます "Undefined index: Submitted in C:\wamp\www\oop_settings\index.php on 13行目
<?php
session_start();
ob_start();
include_once ("includes/settings.php");
include("includes/functions/functions.php");
//include_once ("includes/optional.php");
var_dump($_POST);// Sanity check
if ($_POST['Submitted'] == "true") {
$Errors = "";
$_SESSION['LoggedIn'] = false;
$_SESSION['UserID'] = "";
$_SESSION['UserAdmin'] = false;
// process submitted data
$userSQL = $Database->Execute("SELECT UserID, UserFullname, UserEmail, UserLastPassword FROM Users WHERE UserName = '" . mysql_real_escape_string($Text->ValidSQLString($_POST['Username'])) . "' AND UserPassword = '" . md5($_POST['Password']) . "' AND UserActive = 1 AND UserListingOnly = 0 AND UserID NOT IN (61)");
$UserCount = $Database->RecordCount($userSQL);
//echo $userSQL;
if ($UserCount == 1) {
// user found
$rowUser = $Database->Records($userSQL);
$LastMonth = date("Y-m-d", mktime(0, 0, 0, (date("m") - 1), date("d"), date("Y")));
if ($rowUser['UserLastPassword'] <= $LastMonth) {
// password expired, generate new password
$Errors = "Your password has expired, your new password has been sent to your inbox.";
$NewPassword = $Text->ResetPassword();
$userpasswordSQL = "UPDATE Users SET UserPassword = '" . md5($NewPassword) . "', UserLastPassword = '" . date("Y-m-d") . "' WHERE UserID = " . $rowUser['UserID'];
$dbUserPassword = $Database->Execute($userpasswordSQL) or die ("New Password Query Failed: " . mysql_error());
mail($rowUser['UserEmail'], "Watkins Hire - Your New Password", "Your old password has expired for security reasons.\n\nYour new password is: $NewPassword", "From: password@watkinshire.co.uk");
}// end UserCount
}//end if
}//end if
else {
// valid log in
$_SESSION['LoggedIn'] = true;
$_SESSION['UserID'] = $rowUser['UserID'];
LoginForm(); // call the form function
}// end else if
?>