<?php
$server_Host = '****';
$server_User = '****';
$server_Password = '****';
$server_Database = '****';
$mysqli = new mysqli ($server_Host, $server_User, $server_Password, $server_Database) or die ($mysqli->error);
$email = $mysqli->escape_string($_POST['emailPost']);
$result = $mysqli->query("SELECT * FROM Users WHERE Email='$email'");
if ($result->num_rows == 0) {
echo ("No user was found");
}
else {
$user = $result->fetch_assoc();
if (password_verify($_POST['passwordPost'], $user['Password']) ) {
if ($user['Activated'] == 1) {
echo ("Logged in");
echo ("|ID:" . $user['ID'] . "|Username:" . $user['Username'] . "|Email:" . $user['Email'] . "|First Name:" . $user['First_Name'] . "|Last Name:" . $user['Last_Name'] . "|System:" . $user['System'] . "|Starting Body Fat:" . $user['Starting_Body_Fat'] . "|Starting Weight:" . $user['Starting_Weight'] . "|Starting Lbm:" . $user['Starting_Lbm'] . "|Current Body Fat:" . $user['Current_Body_Fat'] . "|Current Weight:" . $user['Current_Weight'] . "|Current Lbm:" . $user['Current_Lbm'] . "|Goal:" . $user['Goal'] . "|Current Calories:" . $user['Current_Calories'] . "|Quote:" . $user['Quote'] . "|Carb Intake:" . $user['Carb_Intake'] . "|Protein Intake:" . $user['Protein_Intake'] . "|Fat Intake:" . $user['Fat_Intake'] . "|Caloric Intake:" . $user['Caloric_Intake'] . "|Premium:" . $user['Premium'] . "|Status:" . $user['Status'] . "|Activated:" . $user['Activated']);
} else {
echo ("This account has not been activated. If this is your account, please check your email to activate your account.")
;
}
} else {
echo ("Incorrect password");
}
}
这段代码返回一个错误,我确实花了一个小时的时间来查看这个并且找不到错误。我真的很感激一些帮助。