Internal Server Error
Posted by: hamadecd (---.xd-dynamic.algarnetsuper.com.br)
Date: January 26, 2019 12:39AM

I getting the "500 Internal Server Error" message when i try to execute this code:

<?php

$usuario = $_POST['usuario'];
$senha = $_POST['senha'];

$sql = "SELECT * FROM usuarios WHERE usuario = '$usuario' AND senha = '$senha' ";

require_once('db_class.php');

$objDB = new db();
$link = $objDB->conecta_mysql();

$resultado_id = mysqli_query($link, $sql);

if($resultado_id){
	$dados_usuario = mysqli_fetch_array($resultado_id);
	if(isset($dados_usuario['usuario'])){
		
                // error in line below 
                header('Location : home.php');

	}else {
               // here works fine
		header('Location: index.php?erro=1');
	}
	//var_dump($dados_usuario);
}else {
	echo "Erro na execução da consulta";
}

?>



Edited 1 time(s). Last edit at 01/26/2019 04:09PM by RiggsFolly.

Options: ReplyQuote
Re: Internal Server Error
Posted by: Otomatic (Moderator)
Date: January 26, 2019 08:58AM

Hi,

Do you have access to PhpMyAdmin?
Yes, so the problem comes from your code and this forum is not intended to debug user scripts.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Internal Server Error
Posted by: hamadecd (---.xd-dynamic.algartelecom.com.br)
Date: January 27, 2019 04:28AM

Yeah i have and i find the error in my code! Thanks anyway

Options: ReplyQuote


Sorry, only registered users may post in this forum.