Estou tendo dificuldade em fazer login. O script não dá erro, simplesmente não entra na área restrita mesmo os dados de acesso estejam totalmente corretos. Vou postar aqui o código de login.
index.php
<?
session_start();
if ($userid && $password)
{
include "config.php";
// if the user has just tried to log in
$db_conn = mysql_connect($server, $db_user, $db_pass) or die ("Database CONNECT Error (line 11)");
mysql_select_db($database, $db_conn);
$query = "select * from escola_aluno where refid='$userid' and pass='$password'";
$result = mysql_query($query, $db_conn);
if (mysql_num_rows($result) >0 )
{
// if they are in the database register the user id
$valid_user123 = $userid;
session_register("valid_user123");
}
}
// include "header.dom";
if (session_is_registered("valid_user123"))
{
}
else
{
if (isset($userid))
{
// if they've tried and failed to log in
}
else
{
// they have not tried to log in yet or have logged out
}
// provide form to log in
}
include "members_only.php";
?>e agora o outro.
members_only.php
<?
session_start();
// check session variable
if (session_is_registered("valid_user123"))
{
include "config.php";
mysql_connect($server, $db_user, $db_pass) or die ("Database CONNECT Error (line 18)");
$result = mysql_db_query($database, "select * from escola_aluno where refid = '$valid_user123'") or die ("Database INSERT Error (line 19)");
if (mysql_num_rows($result)) {
while ($qry = mysql_fetch_array($result)) {
include "busca_ano.php";
}}}
else
{
include "../top.html";
echo "
<br>
<div align='center'><form method='post' action='index.php'>
<table cellpadding=0 cellspacing=0 bgcolor=#008080 width='300'>
<tr>
<td bgcolor='#F8C618' style='border-style: outset; border-width: 1'>
<p align='left'><font color='#666666' size='3'><b> >> Informe seus dados abaixo:</b></font></td>
</tr>
<tr>
<td bgcolor='#FCE69F'>
<div align='center'>
<center>
<table border='0' cellpadding='0' cellspacing='5' width='300'>
<tr>
<td align='right'><p align=center> <font color='#000080'> Usuário:</font>
</p></td>
<td><font color='#FFFFFF'><input type=text name=userid size=30>
</font>
</td>
</tr>
<tr>
<td align='right'><p align=center><font color='#000080'>
Senha:</font>
</p></td>
<td><font color='#FFFFFF'><input type=password name=password size=30>
</font>
</td>
</tr>
</table>
</center>
</div>
<center><p align=center>
<font color='#FFFFFF'>
<input type=submit value=Acessar>
</font>
</p></center></td>
</tr>
</form>
</table>
<form method=post action=lembrar.php>
<p> </p>
<table align=center border=0 width='300' bgcolor='#008080' cellspacing='0'>
<tr><td bgcolor='#F8C618' style='border-style: outset; border-width: 1'><font color='#666666' size='3'><b> </b><b>>>
</b><b>Lembrar senha:</b></font></td></tr>
<tr><td bgcolor='#FCE69F'>
<div align='left'>
<table border='0' cellpadding='0' cellspacing='5' width='300'>
<tr>
<td><font color='#000080'>E-mail:</font></td>
<td><font color='#FFFFFF'><input type=text name=mail size='30'></font></td>
</tr>
</table>
</div>
<p align='center'><font color='#FFFFFF'><input type=submit value=Enviar></font></p>
</td>
</tr>
<tr><td align=center bgcolor='#FCE69F'>
<font color='#000000' size='1'>Seus dados serão enviados para seu e-mail.</font></tr>
</form></table>
</div>
<p> </p>
<p><font color='#000000' size='2'>OBS: Para acessar esta área é preciso que
você esteja com cookies habilitados em seu navegador.</font></p>
<!-- <p> </p>
<center>
<p><font color='#000000' size='2'>Se você ainda não é cadastrado clique <a href='cadastrar.php'>aqui</a> e se cadastre.</font></p>
</center>
<br>-->
";
include "../fot.html";
}
?>Se alguém puder me ajudar, ficarei muito agradecido!!
Fique na paz de Jesus Cristo!!! Ele te ama!!!
Pode ajudar??
Aguardo ajudas... fique na paz!
Lembrando que não está entrando, ela sempre retorna pra mesma página....
Alguém pode ajudar???










