Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

guilherme014

[RESOLVIDO] Erro em script de login

Recommended Posts

O que será que esta acontencendo?ao logar a página fica em branco.o codigo é este.

<?phpsession_start();if (!session_is_registered("us_id")){ header("Location: ../index.php");}include_once("../funcoes/global.inc.php");include_once("../funcoes/db.inc.php");include_once("../funcoes/funcoes.php");$db = new db();$sessao = session_id();$u = $_SESSION['us_id'];$usuario = $u;$nome = logado($usuario);$t = $_REQUEST['t'];$a = $_REQUEST['a'];if ($a != ""){ $n = $_REQUEST['n']; if ($a == "excluir"){ $db->delete("noticias","id='$n'"); echo "<script> alert('A notícia $n foi deletada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao\""; echo "</script>"; } else if ($a == "alterar"){ echo "<script>"; echo "document.location.href = \"index.php?s=$sessao&t=r&n=$n\""; echo "</script>"; }}$acao = $_REQUEST['acao'];if ($acao == "alterar"){ $id = $_REQUEST['id']; echo "<script>"; echo "document.location.href = \"index.php?s=$sessao&t=w&id=$id\""; echo "</script>";}if ($acao == "excluir"){ $id = $_REQUEST['id']; $db->delete("usuarios","us_id='$id'"); echo "<script> alert('O usuário $id foi deletado com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao\""; echo "</script>";}$submit = $_REQUEST['submit'];if($submit == 1) {//Cadastro de Usuários $nome = $_REQUEST['nome']; $email = $_REQUEST['email']; $email2 = $_REQUEST['email2']; if ((!ereg("^[a-zA-Z0-9_.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))or(empty($email))){ $erro = 1; } $senha = $_REQUEST['senha']; $senha2 = $_REQUEST['senha2']; $setor = $_REQUEST['setor']; $cargo = $_REQUEST['cargo']; $anos = $_REQUEST['anos']; $meses = $_REQUEST['meses']; $profissao = $_REQUEST['profissao']; $ramal = $_REQUEST['ramal']; $aniversario = $_REQUEST['anoA']."-".$_REQUEST['mesA']."-".$_REQUEST['diaA']; $admissao = $_REQUEST['anoD']."-".$_REQUEST['mesD']."-".$_REQUEST['diaD']; $status = $_REQUEST['status']; if ($id == ""){ if (($email != $email2) || ($senha != $senha2) || $erro == 1 || $senha == "") { if ($email != $email2){ $error = "O e-mail e a confirmação do mesmo tem que ser iguais !!!<br>"; } if($senha != $senha2){ $error .= "A senha e a confirmação da mesma tem que ser iguais !!!<br>"; } if ($senha == ""){ $error .= "A senha não pode ficar em branco !!!<br>"; } if ($erro == 1) $error .= "<span class=\"style2\">Seu E-mail está inválido ou em branco !!!</span>"; } else { $data = "now()"; $senha = md5($senha); $campos = array("us_nome"=>$nome, "us_email"=>$email, "us_senha"=>$senha, "us_setor"=>$setor, "us_cargo"=>$cargo, "us_anos"=>$anos, "us_meses"=>$meses, "us_profissao"=>$profissao, "us_ramal"=>$ramal, "us_aniversario"=>"$aniversario", "us_admissao"=>"$admissao", "us_satus"=>$status, "us_data"=>$data); $db->insert("usuarios",$campos); echo "<script> alert('O usuário foi cadastrado com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao\""; echo "</script>"; } } else { $campos = array("us_nome"=>"'$nome'", "us_email"=>"'$email'", "us_setor"=>"'$setor'", "us_cargo"=>"'$cargo'", "us_anos"=>"'$anos'", "us_meses"=>"'$meses'", "us_profissao"=>"'$profissao'", "us_ramal"=>"'$ramal'", "us_aniversario"=>"'$aniversario'", "us_admissao"=>"'$admissao'", "us_satus"=>"'$status'", "us_data"=>"'$data'"); $db->update("usuarios", $campos, "us_id='$id'"); echo "<script> alert('O usuário $id foi alterado com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao\""; echo "</script>"; }} else if ($submit == 2){//Cadastro de Noticias $alterar = $_REQUEST['alterar']; $titulo = $_REQUEST['titulo']; $descricao = $_REQUEST['descricao']; $fonte = $_REQUEST['fonte']; $status = $_REQUEST['status']; if ($alterar != ""){ $data = "now()"; $array = array("no_titulo"=>"'$titulo'","no_descricao"=>"'$descricao'","no_fonte"=>"'$fonte'","no_datacadastro"=>$data,"no_status"=>$status); $data = "now()"; $db->update("noticias",$array,"id='$alterar'"); echo "<script> alert('A notícia $n foi alterada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao\""; echo "</script>"; } else { if ($titulo == "" || $descricao == "" || $fonte == "" || $status == 3){ if ($titulo == "") $error = "O Título não pode ficar em branco !!!<br>"; if ($descricao == "") $error .= "A Descrição não pode ficar em branco !!!<br>"; if ($fonte == "") $error .= "A fonte da mesma não pode ficar em branco !!!<br>"; if ($status == 3) $error .= "Você tem que escolher um status para esta notícia !!!<br>"; echo "<div class=\"error\" align=\"center\"><br>".$error."<br></div><br><br><a href=\"java script:history.go(-1);\">Voltar</a>"; } else { $data = "now()"; $array = array("no_titulo"=>$titulo,"no_descricao"=>$descricao,"no_fonte"=>$fonte,"no_datacadastro"=>$data,"no_status"=>$status); $db->insert("noticias",$array); echo "<script> alert('A Notícia foi cadastrar com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao\""; echo "</script>"; } }} else if ($submit == 3){//Mensagem enviada a todos pelo Administrador $mensagem = $_REQUEST['mensagem']; $sql = "SELECT us_id, us_email FROM usuarios WHERE us_id<>'$u'"; $resultado = $db->select($sql); if ($resultado == true){ for ($a=0;$a<count($resultado);$a++){ $array = array("me_mandou"=>$u, "me_mandar"=>$resultado[$a]["us_id"], "me_mensagem"=>$mensagem, "me_datamandou"=>$data,"me_leu"=>0,"me_tipo"=>"E"); $db->insert("mensagens",$array); $data = "now()"; $sql = "SELECT us_email FROM usuarios WHERE us_id=".$resultado[$a]["us_id"]; $res = $db->select($sql); if ($resultado == true){ for ($i=0;$i<count($res);$i++){ $MailDestino = $res[$i]["us_email"]; email($MailDestino, $mandar); } } } } echo "<script> alert('A mensagem foi enviada com sucesso a todos usuários !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=q\";"; echo "</script>";} else if ($submit == 4){//Cadastro de Enquetes $enquete = $_REQUEST['enquete']; $array = array("pergunta"=>$enquete,"status"=>'N'); $db->insert("perguntas",$array); echo "<script> alert('A enquete foi cadastrada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=m\";"; echo "</script>";} else if ($submit == 5){//Ativar a enquete $id = $_REQUEST['id']; $mudar = "S"; $array = array(status=>"'$mudar'"); $db->update("perguntas",$array,"id='$id'"); echo "<script> alert('A Enquete $id foi ativada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=m\";"; echo "</script>";} else if ($submit == 5){//Ativar a enquete $id = $_REQUEST['id']; echo "<script>"; echo "document.location.href = \"index.php?s=$sessao&t=z&id=$id\";"; echo "</script>";} else if ($submit == 6){//Cadastrar Respostas $id = $_REQUEST['id']; $resposta = $_REQUEST['resposta']); $array = array("resposta"=>$resposta,"id"=>$id); $db->insert("respostas",$array); echo "<script> alert('Uma Resposta a Enquete de nº $id foi adicionada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=z&id=$id\";"; echo "</script>";} else if ($submit == 7){//Fechar Enquetes $id = $_REQUEST['id']; $array = array("status"=>"'F'"); $db->update("perguntas",$array,"id='$id'"); echo "<script> alert('A enquete $id foi fechada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=m\";"; echo "</script>";} else if ($submit == 8){//Apagar Enquetes $id = $_REQUEST['id']; $db->delete("perguntas","id='$id'"); $db->delete("respostas","id='$id'"); echo "<script> alert('A enquete $id e suas respostas foram apagadas com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=m\";"; echo "</script>";} else if ($submit == 9){//Apagar Repostas $id = $_REQUEST['id']; $r = $_REQUEST['r']; $db->delete("respostas","codigo='$r'"); echo "<script> alert('A resposta da enquete $id foi apagada com sucesso !!!');"; echo "document.location.href = \"index.php?s=$sessao&t=m\";"; echo "</script>";} else if ($submit == 10){//Alterar Senha $sql = "SELECT us_senha FROM usuarios WHERE us_id=$u"; $r = $db->select($sql); if($r == true){ for($i=0;$i<count($r);$i++){ $senhaAtual = $r[$i]["us_senha"]; } } if($senhaAtual == md5($_REQUEST['senhaAntiga'])){ $senhaNova = $_REQUEST['senhaNova']; $senha = md5($_REQUEST['senhaNova']); $array = array("us_senha"=>"'".$senha."'"); $db->update("usuarios", $array, "us_id=$u"); $error = "A senha foi alterada com sucesso !!!<br><br>"; } else { $error = "Sua senha atual não é igual a senha que você digitou !!!<br><br>"; }}?><html><head><title>:: Administração da </title><link href="../funcoes/style.css" rel="stylesheet" type="text/css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"></head><body background="../images/fundo.gif" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0><div align="center"><table width="772" border="0" cellspacing="0" cellpadding="0"><tr> <td height="10"></td></tr><tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="29"><img src="../images/lado_cima_1.jpg" width="31" height="108"></td> <td background="../images/fundo_cima.jpg"><img src="../images/cabecalho1.jpg" width="712" height="108"></td> <td width="25"><img src="../images/lado_cima_2.jpg" width="29" height="108"></td> </tr> </table> </td> </tr> <tr> <td></td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <tr> <td width="6" background="../images/fundo_lateral_1.gif"></td> <td > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="5" background="../images/fundo_meio1.jpg"></td> </tr> <tr> <td height="125" background="../images/fundo_area_restrita.jpg"> </td> </tr> <tr> <td height="7" background="../images/fundo_meio.jpg"></td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="196" valign="top" bgcolor="#CCCCCC"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td width="10" rowspan="46"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td width="1" rowspan="47" bgcolor="#CCCCCC"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td width="10"><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=w&u=<?php echo $u;?>" class="texto">Cadastrar Funcionários </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td width="5" height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=as&u=<?php echo $u;?>" class="texto">Alterar Senha </a> </td> <td> </td> </tr> <tr> <td height="5" colspan="3"></td> <td></td> </tr> <tr> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td></td> </tr> <tr> <td height="5" colspan="3"></td> <td></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=u&u=<?php echo $u;?>" class="texto">Listar Funcionários </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=e&u=<?php echo $u;?>" class="texto">Listar Aniversariantes </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=r&u=<?php echo $u;?>" class="texto">Cadastrar Notícias </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=n&u=<?php echo $u;?>" class="texto">Listar Notícias </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=t&u=<?php echo $u;?>" class="texto">Enviar Comunicado Geral </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=m&u=<?php echo $u;?>" class="texto">Editar Enquete </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=x&u=<?php echo $u;?>" class="texto">Enquetes Anteriores </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_not.gif" width="12" height="12" /></td> <td> </td> <td><a href="" target="_blank" class="texto">Voltar ao Site </a> </td> <td width="5"> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="1"> <td height="1" colspan="3" bgcolor="#CCCCCC"></td> <td height="1"></td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr> <td><img src="../images/seta_fotos.gif" width="9" height="10" /></td> <td> </td> <td><a href="index.php?s=<?php echo $sessao;?>&t=s&u=<?php echo $u;?>" class="texto">Sair | Logout </a></td> <td> </td> </tr> <tr height="5"> <td height="5" colspan="3"></td> <td height="5"></td> </tr> <tr height="100%"> <td height="100%" colspan="5" bgcolor="#CCCCCC"></td> </tr> </table></td> <td valign="top"><br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="30"><img src="../images/seta_interna.gif" width="30" height="32" /></td> <td background="../images/fundo_tit_interna.gif" class="titulo">ÁREA ADMINISTRATIVA </td> <td width="30"><a href="java script:history.back()" class="link_1"><img src="../images/bot_voltar.gif" width="30" height="32" border="0" /></a></td> <td width="42" background="../images/fundo_tit_interna1.gif"><div align="center"><a href="java script:history.back()" class="link_1">voltar</a></div></td> <td width="30"><a href="index.php?s=<?php echo $sessao;?>" class="link_1"><img src="../images/bot_home.gif" width="30" height="32" border="0" /></a></td> <td width="42" background="../images/borda_tit_interna.gif"><div align="center"><a href="index.php?s=<?php echo $sessao;?>" class="link_1">home</a></div></td> </tr> </table> <p> </p> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><?phpif ($error != ""){ echo "<div class=\"error\" align=\"center\"><br>".$error."<br></div><br><br>";}if ($t == "") echo "<div align=\"center\"><img src=\"img/Untitled-1.png\"></div>";else if ($t == "u") include "usuarios.php";else if ($t == "t") include "comunicado.php";else if ($t == "e") include "aniversarios.php";else if ($t == "w") include "cadastroUsuarios.php";else if ($t == "r") include "cadastroNoticias.php";else if ($t == "s") include "logout.php";else if ($t == "n") include "listagemNoticias.php";else if ($t == "m") include "enquete/enq_admin.php";else if ($t == "z") include "enquete/enq_cad_resp.php";else if ($t == "x") include "enquete/enq_anteriores.php";else if ($t == "q") include "mandarAniversarios.php"; else if ($t == "as") include "alterarSenha.php";?></td> </tr> </table> </td><td width="16"></td> </tr> </table> </td> </tr> <tr> <td> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="165" height="100%" bgcolor="#CCCCCC"> </td> <td width="31"><img src="../images/img_menu.gif" width="31" height="20"></td> <td> </td> </tr> </table> </td> </tr> </table></td> <td width="6" background="../images/fundo_lateral_2.gif"></td> </tr> </table></td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32"><img src="../images/lado_baixo_1.jpg" width="32" height="44"></td> <td background="../images/fundo_baixo.jpg"><div align="right"><img src="../images/copy_right.gif" width="102" height="7"></div></td> <td width="26"><img src="../images/lado_baixo_2.jpg" width="26" height="44"></td> </tr> </table></td> </tr> </table></div></body></html><?php$db->close();?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

oo provavelmente deve ser algum ; ou }... ou outra coisa que você deve ter esquecido de fechar....dah uma reolhada no seu código procurando esses erros....

Compartilhar este post


Link para o post
Compartilhar em outros sites

tem um erro na linha 320:

 

$resposta = $_REQUEST['resposta']);....................................^

erro resolvido:

$resposta = $_REQUEST['resposta'];

Compartilhar este post


Link para o post
Compartilhar em outros sites

tem um erro na linha 320:

$resposta = $_REQUEST['resposta']); ....................................^
erro resolvido:
$resposta = $_REQUEST['resposta'];
valeu.....

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.