hello guys, i have a system login and i put the correct login and password and the script is correct but don´t show any information about the user

<?

if (isset($_POST['usr']) && isset($_POST['pwd'])) {

$usr = stripslashes($_POST['usr']);

$sql = mysql_query("SELECT * FROM usuarios WHERE login = '".$usr."'");
$campo = mysql_fetch_array($sql);

   if  (($_POST['usr'] && $_POST['pwd']) == '') {
       print "Login ou Senha Incorreto!<br><a href=''>Clique aqui</a> para tentar novamente.\n";
       
} else if ($_POST['pwd'] != $campo['senha']) {
 print "Login ou Senha Incorreto!<br><a href=''>Clique aqui</a> para tentar novamente.\n";
 
} else if ($_POST['usr'] != $campo['login']) {
        print "Login ou Senha Incorreto!<br><a href=''>Clique aqui</a> para tentar novamente.\n";
    } else {
   
   
while ($row = mysql_fetch_array($sql)) {
$nome=$row[nome];
$senhasis=$row[senhasis];
$datacadastro=$row[datacadastro];
$endereço=$row[endereço];
   
 session_start();

 print "
<div align='center'>
 <center>

 <table border='0' width='100%'>
   <tr>
     <td width='100%'><center><font size='1'><b>$nome</b></font></center></td>
   </tr>
 </table>
 
  <table border='0' width='56%'>
   <tr>
     <td width='29%'><font size='1'>Senha do SISTEMA:</font></td>
     <td width='71%'><font size='1'>$senhasis</font></td>
   </tr>
   <tr>
     <td width='29%'>&nbsp;</td>
     <td width='71%'>&nbsp;</td>
   </tr>
   <tr>
     <td width='29%'><font size='1'>Cadastrado desde:</font></td>
     <td width='71%'><font size='1'>$datacadastro</font></td>
   </tr>
   <tr>
     <td width='29%'><font size='1'>Endereço:</font></td>
     <td width='71%'><font size='1'>$endereço</font></td>
   </tr>
 </table>
 </center>
</div>
 ";
?>

<?
$sql2 = "SELECT * FROM boleto WHERE login = '".$usr."' ";
$result2 = mysql_query($sql2);
while ($row2 = mysql_fetch_array($result2)) {
$sacado=$row2[sacado];
$data_vencimento=$row2[data_vencimento];
$valor_boleto=$row2[valor_boleto];
$cod_seg=$row2[cod_seg];

print "
<br>
<div align='center'>
 <center>
 <table border='0' width='100%'>
   <tr>
     <td width='100%'>
       <p align='center'><font size='1'><b>Faturas Pendentes</b></font></td>
   </tr>
 </table>
 </center>
</div>
<div align='center'>
 <center>
 <table border='0' width='100%'>
   <tr>
     <td width='33%'>
       <p align='center'><font size='1'>Nome</font></td>
     <td width='33%'>
       <p align='center'><font size='1'>Vencimento</font></td>
     <td width='34%'>
       <p align='center'><font size='1'>Valor</font></td>
   </tr>
   <tr>
     <td width='33%'>
       <p align='center'><font size='1'>$sacado</font></td>
     <td width='33%'>
       <p align='center'><font size='1'>$data_vencimento</font></td>
     <td width='34%'>
       <p align='center'><font size='1'>R$ $valor_boleto</font></td>
   </tr>
 </table>
 </center>
</div>
<br>
<div align='center'>
 <center>
 <table border='0' width='100%'>
<tr>
     <td width='100%'>
       <p align='center'><font size='1'><a href='admin.php?act=ver_boleto&cod_seg=$cod_seg'>Visualizar Boleto Bancário</a></font></td>
   </tr>
 </center>
</div>
";
}
?>

<?

}
}

} else {

print "<center><form action='?act=login' method='post'>\n";
print "Usuário:<br><input type='text' name='usr' size='20'><br>\n";
print "Senha:<br><input type='password' name='pwd' size='20'><p>\n";
print "<input type='submit' value='( Entrar )'></form>\n";

}

mysql_close() or die("");

?>

Do you not need quotes around the array item you are calling?
i.e

$cod_seg=$row2

event try
print_r($row);
print_r($row2);

to verify your queryies have a result set in them

nothing guy i tried and not success where is the problem? =/

What is the error exactly?

Anyway try the following

<?

if (isset($_POST['usr']) && isset($_POST['pwd'])) {

$usr = stripslashes($_POST['usr']);

$sql = mysql_query("SELECT * FROM usuarios WHERE login = '".$usr."'");
$campo = mysql_fetch_array($sql);

   if  (($_POST['usr'] && $_POST['pwd']) == '') {
       print "Login ou Senha Incorreto!<br><a href=''>Clique aqui</a> para tentar novamente.\n";
       
} else if ($_POST['pwd'] != $campo['senha']) {
print "Login ou Senha Incorreto!<br><a href=''>Clique aqui</a> para tentar novamente.\n";

} else if ($_POST['usr'] != $campo['login']) {
        print "Login ou Senha Incorreto!<br><a href=''>Clique aqui</a> para tentar novamente.\n";
    } else {
   
   
while ($row = mysql_fetch_array($sql)) {
$nome=$row['nome'];
$senhasis=$row['senhasis'];
$datacadastro=$row['datacadastro'];
$endereço=$row['endereço'];
   
session_start();

print "
<div align='center'>
<center>

<table border='0' width='100%'>
   <tr>
     <td width='100%'><center><font size='1'><b>$nome</b></font></center></td>
   </tr>
</table>

  <table border='0' width='56%'>
   <tr>
     <td width='29%'><font size='1'>Senha do SISTEMA:</font></td>
     <td width='71%'><font size='1'>$senhasis</font></td>
   </tr>
   <tr>
     <td width='29%'>&nbsp;</td>
     <td width='71%'>&nbsp;</td>
   </tr>
   <tr>
     <td width='29%'><font size='1'>Cadastrado desde:</font></td>
     <td width='71%'><font size='1'>$datacadastro</font></td>
   </tr>
   <tr>
     <td width='29%'><font size='1'>Endereço:</font></td>
     <td width='71%'><font size='1'>$endereço</font></td>
   </tr>
</table>
</center>
</div>
";
?>

<?
$sql2 = "SELECT * FROM boleto WHERE login = '".$usr."' ";
$result2 = mysql_query($sql2);
while ($row2 = mysql_fetch_array($result2)) {
$sacado=$row2['sacado'];
$data_vencimento=$row2['data_vencimento'];
$valor_boleto=$row2['valor_boleto'];
$cod_seg=$row2['cod_seg'];

print "
<br>
<div align='center'>
<center>
<table border='0' width='100%'>
   <tr>
     <td width='100%'>
       <p align='center'><font size='1'><b>Faturas Pendentes</b></font></td>
   </tr>
</table>
</center>
</div>
<div align='center'>
<center>
<table border='0' width='100%'>
   <tr>
     <td width='33%'>
       <p align='center'><font size='1'>Nome</font></td>
     <td width='33%'>
       <p align='center'><font size='1'>Vencimento</font></td>
     <td width='34%'>
       <p align='center'><font size='1'>Valor</font></td>
   </tr>
   <tr>
     <td width='33%'>
       <p align='center'><font size='1'>$sacado</font></td>
     <td width='33%'>
       <p align='center'><font size='1'>$data_vencimento</font></td>
     <td width='34%'>
       <p align='center'><font size='1'>R$ $valor_boleto</font></td>
   </tr>
</table>
</center>
</div>
<br>
<div align='center'>
<center>
<table border='0' width='100%'>
<tr>
     <td width='100%'>
       <p align='center'><font size='1'><a href='admin.php?act=ver_boleto&cod_seg=$cod_seg'>Visualizar Boleto Bancário</a></font></td>
   </tr>
</center>
</div>
";
}
?>

<?

}
}

} else {

print "<center><form action='?act=login' method='post'>\n";
print "Usuário:<br><input type='text' name='usr' size='20'><br>\n";
print "Senha:<br><input type='password' name='pwd' size='20'><p>\n";
print "<input type='submit' value='( Entrar )'></form>\n";

}

mysql_close() or die("");

?>

the error is: i put the correct login and correct password then i log in but don´t show any information about the user

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.