Search the Community
Showing results for tags 'error 500'.
-
I'm getting and Error 500 from my server. I'm not sure why... I think it might be my code. Can someone take a look please. localhost is currently unable to handle this request. HTTP ERROR 500 <?php include("common/common.php"); include("../common/db_connector.php"); $email_sent = $_POST["inputEmail"]; $password_sent = md5($_POST["inputPassword"]); // Check database for user credentials... $sql = "SELECT * FROM users WHERE email = '$email_sent'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { //checks for true conditions if password and meail match database...... if($email_sent == $row["email"] AND $password_sent == $row["password"]) { $_SESSION["username"] = $email_sent; echo "<script>window.location = 'dashboard/index.php';</script>"; } else { echo "<script>alert('access denied'); window.location = 'index.php';</script>"; } } } ////////////////////////////////////////////// ?>
- 5 replies
-
- error 500
- select query
-
(and 3 more)
Tagged with:
-
Im having trouble on my php script. it is working on my computer but when I put it in x10hosting it fails and gives an error 500. I tried tracing the problem and I found out that it happens if I call get_result. Here is the part code: $username = strtolower(filter_input(INPUT_POST, 'username')); $password = filter_input(INPUT_POST, "password"); $remember = filter_input(INPUT_POST, "remember"); $result = array(); include 'Connection.php'; $query = "SELECT Number, Username, Password, Alias, Level FROM user WHERE Username = ?;"; $stmt = $conn->prepare($query); if(!$stmt->prepare($query)) { die( "Failed to prepare statement."); } $stmt->bind_param("s", $username); $stmt->execute(); echo $stmt->error; //error hapens here $selectResult = $stmt->get_result();