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 500localhost
Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.9
avatar laurentellyzabeth

@laurentellyzabeth

11 Kontribusi 0 Poin

  • Share kodenya juga dong mba, biar bisa bantu cek sama yg lain juga - @ahanafi
  • Aktifkan PHP Error nya, lalu share kodingannya biar jelas - @cyanotic


Jawaban

Server error itu sangat luas, bisa kesalaha dari mana saja.
Salah satu cara debugnya dengan mengaktifkan error PHP, agar ketahuan masalahnya di mana jika dari kodenya
avatar hilmanski

@hilmanski

2390 Kontribusi 2000 Poin


<?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>

	<h1 >Halaman Login</h1>
	
	<?php if(isset($error)) : ?>
		<p style="color: red; font-style: italic;">Username atau Password yang dimasukkan salah ! </p>
	<?php endif; ?>

	<form action="" method="post">
		
		<ul>
			<li>
				<label for="username">Username</label>
				<input type="text" name="username" id="username">
			</li>
			<li>
				<label for="password">Password</label>
				<input type="password" name="password" id="password">
			</li>
			<li>
				<button type="submit" name="login">Login</button>
			</li>
		</ul>

	</form> 
</body>
</html>
avatar laurentellyzabeth

@laurentellyzabeth

11 Kontribusi 0 Poin


Login untuk gabung berdiskusi
premium logo tube

Hey, sedang ada diskon premium untuk akses semua kelas. Lihat di sini