Ir para conteúdo
Fórum Script Brasil
  • 0

Oi Boa Tarde.presciso De Uma Ajuda. De Novo


Aron

Pergunta

Bom vamos la e mais ou menos o que eu quero fazer

Usei um sistema de seção.

apos o usuario estar logado quero que pegue alguns dados no bd.

tais como..

nome, telefone1, telefone2, telefone3, telefone4,

o bd e usuarios enom to consseguindo com esse

<?php

include("config.php");

$email=$_SESSION['email'];

$ac=mysql_query("select* from usuarios where email=$email'");

$r=mysql_fetch_array($ac);

$nome=$r['nome];

echo"<b>$nome</b>";

?>

o que está errado?

esse e pra exibir so o nome...

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

Toda vez que você for utilizar SESSION, você terá que usar o session_star() ^^

um exemplo ai pra você:

<?
session_start();

include "config.php";
$ac = mysql_query("SELECT * FROM usuarios");
while($x = mysql_fetch_array($ac)){ 
echo '$x['nome']';
?>

Link para o comentário
Compartilhar em outros sites

  • 0

<?php
include("bloc.php");
include("cs.php");
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;">
<link rel="stylesheet" href="css/css.css" type="text/css">
<style type="text/css">
<!--
.style4 {font-size: 10px}
.style5 {
    color: #2D1656;
    font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="775" align="center">
   <tr> 
    <td><img src="img/idx/spacer.gif" width="775" height="1" border="0"></td>
    <td><img src="img/idx/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <div align="center"> 
        <?php include("links2.php"); ?>
        <br>
        <table width="100%" border="0" cellspacing="6" cellpadding="0" class="css">
          <tr> 
            <td height="100" valign="top"><table width="100%" height="100%" border="0">
              <tr>
                <td width="360"><img src="img/logo.jpg" width="360" height="104"></td>
                <td width="393"><table width="100%" height="100%" border="0">
                  <tr>
                    <td colspan="3" nowrap bgcolor="#D2E9A9"><div align="center">Seus Telefones </div></td>
                    </tr>
                  <tr>
                    <td width="55%" nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade1</div></td>
                    <td width="11%" nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD1</div></td>
                    <td width="34%" nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone1</div></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade2</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD2</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone2</div></td>
                    </tr>
                  <tr>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade3</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD3</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone3</div></td>
                    </tr>
                  <tr>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade4</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD4</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone4</div></td>
                    </tr>
                  <tr>
                    <td colspan="3" nowrap bgcolor="#D2E9A9">&nbsp;</td>
                    </tr>
                  
                </table></td>
              </tr>
              <tr>
                <td height="20" colspan="2"><span class="style4">Seja bem vindo</span>                  
<?php
include("config.php");
$email=$_SESSION['email'];
$ac=mysql_query("select* nome from usuarios where email='$email'");
$r=mysql_fetch_array($ac);
$nome=$r['nome'];
echo"<b>$nome</b>";
?>
<?
session_start();
include "config.php";
$ac = mysql_query("SELECT * FROM usuarios");
while($x = mysql_fetch_array($ac)){ 
echo '$x['nome']';
?></td>
              </tr>
            </table></td>
          </tr>
          <tr> 
            <td bgcolor="#D2E9A9"> 
              <div align="center" class="style5">Verifique 
            abaixo os conte&uacute;dos  dispon&iacute;veis </div>            </td>
          </tr>
          <tr> 
            <td> 
              <div align="center"></td>
          </tr>
          <tr> 
            <td><div align="center"><?php include("tpl_verinfo.php"); ?></div></td>
          </tr>
        </table>
      </div>
</table>
</body>
</html>

Link para o comentário
Compartilhar em outros sites

  • 0

você quer que apareça o nome da pessoa né??

<?
session_start();

if ( !isset($_SESSION['nome']) ){
  echo "Você tem que fazer seu login!";
}
?>
<?php
include("bloc.php");
include("cs.php");
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;">
<link rel="stylesheet" href="css/css.css" type="text/css">
<style type="text/css">
<!--
.style4 {font-size: 10px}
.style5 {
    color: #2D1656;
    font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="775" align="center">
   <tr>
    <td><img src="img/idx/spacer.gif" width="775" height="1" border="0"></td>
    <td><img src="img/idx/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">
      <div align="center">
        <?php include("links2.php"); ?>
        <br>
        <table width="100%" border="0" cellspacing="6" cellpadding="0" class="css">
          <tr>
            <td height="100" valign="top"><table width="100%" height="100%" border="0">
              <tr>
                <td width="360"><img src="img/logo.jpg" width="360" height="104"></td>
                <td width="393"><table width="100%" height="100%" border="0">
                  <tr>
                    <td colspan="3" nowrap bgcolor="#D2E9A9"><div align="center">Seus Telefones </div></td>
                    </tr>
                  <tr>
                    <td width="55%" nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade1</div></td>
                    <td width="11%" nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD1</div></td>
                    <td width="34%" nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone1</div></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade2</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD2</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone2</div></td>
                    </tr>
                  <tr>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade3</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD3</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone3</div></td>
                    </tr>
                  <tr>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Cidade4</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">DDD4</div></td>
                    <td nowrap bgcolor="#D2E9A9"><div align="center" class="style4">Telefone4</div></td>
                    </tr>
                  <tr>
                    <td colspan="3" nowrap bgcolor="#D2E9A9">&nbsp;</td>
                    </tr>
                  
                </table></td>
              </tr>
              <tr>
                <td height="20" colspan="2"><span class="style4">Seja bem vindo</span>                  
<? echo $_SESSION['nome']; ?></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#D2E9A9">
              <div align="center" class="style5">Verifique
            abaixo os conte&uacute;dos  dispon&iacute;veis </div>            </td>
          </tr>
          <tr>
            <td>
              <div align="center"></td>
          </tr>
          <tr>
            <td><div align="center"><?php include("tpl_verinfo.php"); ?></div></td>
          </tr>
        </table>
      </div>
</table>
</body>
</html>
Tenta aí... PS: SÓ PRA AVISAR QUE ESSE PROBLEMA JÁ FOI RESOLVIDO ;) O ERRO ESTAVA AQUI:
$ac=mysql_query("select* from usuarios where email='$email'");

ELE QUERIA BUSCA O NOME E não O EMAIL :lol:

rs

[]''s

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...