Postingan lainnya
SERVEEER ERRORR TUH GIMANA NGATASINYA????
jadi seperti ini...
Ada yang bilang Cek File htaccess.tapi in my case there is no htaccess file but the error is same. What should I do now?
atau ganti versi phpnya?
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.9
2 Jawaban:
<div>Server error itu sangat luas, bisa kesalaha dari mana saja.<br>Salah satu cara debugnya dengan mengaktifkan error PHP, agar ketahuan masalahnya di mana jika dari kodenya</div>
Tanggapan
php error nya masih aktif kok gan
<pre><?php
require 'functions.php';
if(isset($_POST["login"]) ) {
$username = $_POST["username"];
$password = $_POST["password"];
$result = mysqli_query($conn,"SELECT * FROM user WHERE username = '$username'");
//cek username
if(mysqli_num_rows($result) === 1) {
//cek password
$row = mysqli_fetch_assoc($result);
if(password_verify($password, $row["password"])) {
header("Location : index.php");
exit;
}
}
$error = true;
}
?>
<!DOCTYPE html> <html> <head> <title>Halaman Login</title> </head> <body>
&lt;h1 &gt;Halaman Login&lt;/h1&gt;
&lt;?php if(isset($error)) : ?&gt;
&lt;p style="color: red; font-style: italic;"&gt;Username atau Password yang dimasukkan salah ! &lt;/p&gt;
&lt;?php endif; ?&gt;
&lt;form action="" method="post"&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;label for="username"&gt;Username&lt;/label&gt;
&lt;input type="text" name="username" id="username"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;label for="password"&gt;Password&lt;/label&gt;
&lt;input type="password" name="password" id="password"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;button type="submit" name="login"&gt;Login&lt;/button&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/form&gt;
</body> </html></pre>