Hello, I would like to know when someone is logged in to create a button of type FILE. This created the system of registration and login, but I do not know how to know when it is logged in or not.
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LuppBox</title>
<link rel="stylesheet" type="text/css" href="estilo_index.css"/>
</head>
<body bgcolor="#0099FF">
<ul id="cabecario">
<li id="logo"><img src="fotos_site/logo.png" width="auto" height="60" /></li>
<li id="login_cadastro_css"><a href="login_cadastro.php">Login | Cadastro</a></li>
</ul>
</body>
</html>
do_login.php
<?
include "connection.php";
$login = $_POST['login_entrar'];
$senha = $_POST['senha_entrar'];
$sql = mysqli_query($coneccao, "SELECT * FROM usuarios WHERE login = '$login'");
while($linha = mysqli_fetch_array($sql))
{
$senha_db = $linha['senha'];
}
$cont = mysqli_num_rows($sql);
if($cont == 0)
{
echo "<meta http-equiv='refresh' content='0; url=index.php'>
<script type='text/javascript'>alert('Este usuario não existe')</script>";
}
else
{
if($senha_db != $senha)
{
echo "<meta http-equiv='refresh' content='0; url=index.php'>
<script type='text/javascript'>alert('Senha incorreta')</script>";
}
else
{
session_start();
$_SESSION['login_usuario'] = $login;
$_SESSION['senha_usuario'] = $senha;
header("location: perfil.php");
}
}
mysqli_close($coneccao);
?>
hacer_cadastro.php
<?
include "connection.php";
$login = $_POST['login_entrar'];
$senha = $_POST['senha_entrar'];
$sql = mysqli_query($coneccao, "SELECT * FROM usuarios WHERE login = '$login'");
while($linha = mysqli_fetch_array($sql))
{
$senha_db = $linha['senha'];
}
$cont = mysqli_num_rows($sql);
if($cont == 0)
{
echo "<meta http-equiv='refresh' content='0; url=index.php'>
<script type='text/javascript'>alert('Este usuario não existe')</script>";
}
else
{
if($senha_db != $senha)
{
echo "<meta http-equiv='refresh' content='0; url=index.php'>
<script type='text/javascript'>alert('Senha incorreta')</script>";
}
else
{
session_start();
$_SESSION['login_usuario'] = $login;
$_SESSION['senha_usuario'] = $senha;
header("location: perfil.php");
}
}
mysqli_close($coneccao);
?>
I would like to put a FILE button there under that case you are logged in.
Thank you in advance.