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.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.9 32 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27 - MariaDB 10.3.16
Wampserver 3.1.9 64 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27/8.0.17 - MariaDB 10.3.16
PhPMyadmin 4.9.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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.