is currently unable to handle this request. HTTP ERROR 500

Ini terjadi setelah saya melakukan login di website yg saya buat

form login tsb actionnya mengarah ke login.php, dimana login php berisi code :

require('connection.php');
		$user = $_POST['user'];
		$pass = $_POST['pass'];
		$loginto = $_POST['loginto'];
		// $op = $_GET['op'];

		$login = $mysqli->query("SELECT * FROM tb_login WHERE username ='$user' AND pass = '$pass'");
		$result = mysqli_num_rows($login);
		// if($op=="in"){
			if(!empty(trim($user)) && !empty(trim($pass))){
				if($result==1){
					$qry = mysqli_fetch_array($login);
		        	$_SESSION['username'] = $qry['username'];
					$_SESSION['pass']     = $qry['pass'];
		        	$_SESSION['access']   = $qry['access'];
		        	if($loginto == 'inventory'){

		   	        	if($qry['access']=="admin"){
			        		?><script>
								swal({
	  							title: "Login Success!",
	 							text: "",
	 							type: "success",
		  						timer: 2000,
	  							showConfirmButton: false
							});
							function load_home() {
	     						document.location='main.php';
							}
							setTimeout(function(){ load_home(); }, 2500);
							</script><?php
						}else{
			        		?><script>
								swal({
	  							title: "You don't have access to this page!",
	 							text: "",
	 							type: "warning",
		  						timer: 2000,
	  							showConfirmButton: false
							});
							function load_home() {
	     						document.location='index.php';
							};
							setTimeout(function(){ load_home(); }, 2500);
							</script><?php
						}
					}

					else if($loginto == 'customerprofile'){

						?><script>
								swal({
	  							title: "Login Success!",
	 							text: "",
	 							type: "success",
		  						timer: 2000,
	  							showConfirmButton: false
							});
							function load_home() {
	     						document.location='fis/index.html';
							}
							setTimeout(function(){ load_home(); }, 2500);
							</script><?php

					}

				}else{
					?>
					<script>
						swal({
  						title: "Invalid username or password!",
 						text: "Make sure your username and password is correct",
 						type: "warning",
  						timer: 4000,
  						showConfirmButton: false
					});
					function load_home() {
     					document.location='index.php';
					}
					setTimeout(function(){ load_home(); }, 4500);
					</script>
				<?php
				}
			}else{
				?>
				<script>
					swal({
  						title: "Username and password is empty!",
 						text: "",
 						type: "error",
  						timer: 2000,
  						showConfirmButton: false
					});
					function load_home() {
     					document.location='index.php';
					}
					setTimeout(function(){ load_home(); }, 2500);
				</script>
				<?php
			}

apakah ada kesalahan dalam document.location nya sehingga setelah submit/login tidak redirect ke halaman yang diminta? sedangkan kalo saya coba di local, ini berjalan saja

terimakasih

avatar erikaristayasa
@erikaristayasa

9 Kontribusi 0 Poin

Dipost 7 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban