Anexar o usuário apos feito o login.
Gente agora eu não tenho um código definido por que não sei nem como começar isso.
O que quero fazer é o seguinte, apos feito o login com email e senha, no menu em vez de aparecer o nome "login" aparecer "Iury" no lugar, como faço isso?
Talveis posso lhes dar o código do meu login e meu index:
Aki esta meu login php, onde ele verifica no banco se exite o usuario caso sim ele manda para o index caso não retorna para o login de novo.
login.php
<?php
header('Content-Type: text/html; charset=utf-8', true);
// ---- INICIO DAS CONFIGURAÇÕES MYSQL ----
$host = 'localhost'; // endereço do seu mysql
$user = 'root'; // usuário
$pass = ''; // senha
$con = mysql_connect($host,$user,$pass); // função de conexão
$db = 'contato'; // nome do banco de dados
mysql_select_db($db,$con) or print mysql_error(); // seleção do banco de dados
// ----- FIM DAS CONFIGURAÇÕES DE MYSQL ----
// NOTA - NÃO SE ESQUEÇA DE POR NA TAG <FORM> DE SUA OUTRA PÁGINA - action="nomepagina.php" ( <- altere "nomepagina" para o nome dessa página aqui )
// method="post" <- ESSE EH O METODO DE ENVIO.
// RECEBENDO DADOS DO FORMULARIO
$dados = $_POST['email']; // EM LOGIN COLOQUE O NOME DO SEU INPUT FEITO NO FORMULARIO
$dados = $_POST['senha']; // $_POST PODE SER ALTERADO PARA O METODO QUE VOCÊ DEFINIU NO FORMULARIO
//
// $dados = '0'; // LINHA APENAS PARA TESTE DA CONSULTA. CASO QUEIRA TESTAR O FUNCIONAMENTO SEM USAR O $_POST, DESCOMENTE ESSA LINHA E COMENTE A $_POST
$sql = mysql_query("SELECT * FROM servidor WHERE email LIKE '%$dados%' OR senha LIKE '%$dados%'") or die(mysql_error()); // O DIE SERVE PARA RETORNAR MENSAGEM DE ERRO.
$count = mysql_num_rows($sql);
if($count >= 1) {
header('Location:../index.html');//COLOCAR O NOME DA PAGINA CORRETAMENTE!
}
else {
header('Location:..login2.html');//COLOCAR O NOME DA PAGINA CORRETAMENTE!
}
// FIM DO CÓDIGO
?>
Aki esta meu index.html:
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]> <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="UTF-8" />
<title>Damiond Black</title>
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/style3.css" />
<script type="text/javascript" src="js/modernizr.custom.86080.js"></script>
<!--Menu-->
<link rel="stylesheet" href="css/colorbox.css" />
<script src="[https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js](https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js)"></script>
<script src="js/jquery.colorbox.js"></script>
<script>
$(document).ready(function(){//Examples of how to assign the Colorbox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
$('.non-retina').colorbox({rel:'group5', transition:'none'})
$('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
<!--Menu-->
</head>
<audio src="musicas/George Michael - Too Funky.mp3" autoplay></audio>
<body id="page">
<ul class="cb-slideshow">
<li><span>Image 01</span><div><h3>Diamond Black</h3></div></li>
<li><span>Image 02</span><div><h3>A moda</h3></div></li>
<li><span>Image 03</span><div><h3>Ao seu estilo</h3></div></li>
<li><span>Image 04</span><div><h3>Ao seu gosto</h3></div></li>
<li><span>Image 05</span><div><h3>acesse o site e confira</h3></div></li>
<li><span>Image 06</span><div><h3>Os mais variados vestido</h3></div></li>
</ul>
<div class="container">
<!-- Codrops top bar -->
<div class="codrops-top">
<span class="right">
</span>
<div class="clr"></div>
</div><!--/ Codrops top bar -->
<header>
<div align="right">
<p class="codrops-demos">
<a class='iframe' href="formulario/login2.php">Login </a>
</p>
</div>
<h1>Diamond <span>Black</span></h1>
<h2>A moda ao seu estilo!</h2>
<p class="codrops-demos">
<a href="index.html">Inicio </a>
<a class='iframe' href="moda/vestido/vestidos.html">Vestido </a>
<a class='iframe' href="formulario/CSSKarma.htm">Contato </a>
<a class='iframe' href="formulario/form_cadastro.html">Cadastre-se</a>
</p>
</header>
</div>
</body>
</html>Discussão (14)
Carregando comentários...