I'm making an initial user verification page, with their respective passwords. This information is extracted from a table in the MySQL database. I made the connection to the database correctly, and when making the connection or trying the file "index.php" I get the following error:
does not show if it is connected.
connections.php
<?php
$conexion = new mysqli("localhost","root","admin123","trujii")
if($conexion)
{
echo "conexion exitosa";
else
{
echo "conexion no exitosa";
}
}
?>
index.php
<!DOCTYPE html>
<html>
<head>
<title>index</title>
</head>
<body>
<center>
<br/><br/>
<form action="proceso.php" method="POST">
<input type="text" name="usuario" value="" placeholder="usuario..."/>
<input type="password" name="contrasena" value="" placeholder="contrasena..."/>
<input type="submit" value="aceptar"/>
</form>
</center>
</body>
</html>
proces.php
<?php
session_start();
$usuario = $_POST['usuario'];
$contrasena = $_POST['contrasena'];
include("conexion.php");
$proceso = $conexion->query("SELECT * FROM admin WHERE user = '$usuario' AND pw = '$contrasena'");
if ($resultado = mysqli_fetch_array($proceso))
{
$_SESSION['u_usuario'] = $usuario;
//header("Location: sesion.php");
echo "sesion exitosa";
}
else
{
//header("Location: index.php");
echo "sesion no exitosa";
}
?>