Secret Experience

Secret Experience (https://secretexperience.net/)
-   [L2J] Pedidos (https://secretexperience.net/l2j-pedidos/)
-   -   [Interlude] algum PROGRAMADOR de PHP poderia arrumar esse SCRIPT meu axo que fiz algo de errado (https://secretexperience.net/l2j-pedidos/16807-algum-programador-de-php-poderia-arrumar-esse-script-meu-axo-que-fiz-algo-de-errado.html)

ManoeL-ADM 10-12-2009 08:58 PM

algum PROGRAMADOR de PHP poderia arrumar esse SCRIPT meu axo que fiz algo de errado
 
tipo ta dando esse erro

Citação:

Parse error: syntax error, unexpected T_ELSE in C:\AppServ\www\registre-se.php on line 239



[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]




se alguem arruma pra mim e postasse novamente ficaria muito grato ....


grato desde ja!

paytaly 10-12-2009 09:18 PM

Código PHP:

<?php
include ("config/config.php");
include(
"config/botaodireito.php")
?>
<script language="JavaScript">
<!-- Javascript que atualiza a imagem
var URL = unescape(window.location.pathname);

function refresh()
{
    window.location.href = URL;
}
//-->
</script>
<script type="text/JavaScript">

function isAlphaNumeric(value)
{
  if (value.match(/^[a-zA-Z0-9]+$/))
    return true;
  else
    return false;
}
function checkform(f)
{
  if (f.nome_completo.value=="")
  {
    alert("Coloque seu NOME COMPLETO!");
    return false;
  }
  if (f.login.value=="")
  {
    alert("Escolha um LOGIN!");
    return false;
  }
  if (f.senha.value=="")
  {
    alert("Coloque uma SENHA!");
    return false;
  }
  if (f.email.value=="")
  {
    alert("Coloque um E-MAIL!");
    return false;
  }
  if (f.telefone.value=="")
  {
    alert("Coloque seu TELEFONE!");
    return false;
  }
  if (f.pergunta_secreta.value=="")
  {
    alert("Escolha uma PERGUNTA SECRETA!");
    return false;
  }
  if (f.resposta_secreta.value=="")
  {
    alert("Coloque uma RESPOSTA SECRETA!");
    return false;
  }
  if (f.senha.value!=f.senha2.value)
  {
    alert("As duas senhas não estão IGUAIS!");
    return false; 
  }
  return true;
}
</script><head>
<style type="text/css">
<!--
body {
    background-image: url(img/bg1.gif);
}
-->
</style>
<link href="css/cursor.css" rel="stylesheet" type="text/css" />
<link href="css/registre-se.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="css/favicon.ico" />
<title>Cadastro</title><style type="text/css">
<!--
a:link {
    text-decoration: none;
}
a:visited {
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}
a:active {
    text-decoration: none;
}
.style1 {
    font-size: 12px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
}
.cima {font-size: 18px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; }
.style4 {
    color: #990000;
    font-weight: bold;
    font-size: 18px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
}
</style>
</head>
<form method="post" action="registre-se.php" onsubmit="return checkform(this)"><center>
<div align="center"><span class="style4">Registro de uma nova CONTA </span><br />
<br />
<br />
</div>
<table>
 <tr>
   <td width="200"><div align="left" class="style1"  id="tudo">
       <div align="right">Nome Completo - </div>
   </div></td>
   <td width="144"><input type="text" name="nome_completo" id="nomecompleto" maxlength="80" size="20" /></td>
 </tr>
 <tr>
   <td><div align="left" class="style1"  id="tudo">
       <div align="right"> Login - </div>
   </div></td>
   <td><input type="text" name="login" id="login" maxlength="45" size="20" /></td>
 </tr>
 <tr>
  <td colspan="2" style="text-align: center;">
    <p><br />
      <span class="style1"><strong>Sua senha deve ser iniciada com uma letra e devera <br />
      conter somente letras (minusculas) e numeros.</strong></span><br />
      <br />
    </p>    </td>
 </tr>
</table>
<table>
  <tr>
    <td width="269" class="style1"><div id="div"align="left">
      <div align="right">Senha - </div>
    </div></td>
    <td width="213"><input type="password" name="senha" id="senha" maxlength="45" size="20" /></td>
  </tr>
  <tr>
    <td class="style1"><div id="div"align="left">
      <div align="right">Repita a senha - </div>
    </div></td>
    <td><input type="password" name="senha2" id="senha" maxlength="45" size="20" /></td>
  </tr>
  <tr>
    <td class="style1"><div  id="div2"align="left">
        <div align="right">E-Mail - </div>
    </div></td>
    <td><input type="text" name="email" id="email" maxlength="60" size="20" /></td>
  </tr>
  <tr>
    <td class="style1"><div  id="div2"align="left">
        <div align="right">Telefone - </div>
    </div></td>
    <td><input type="text" name="telefone" id="telefone" maxlength="20" size="20" /></td>
  </tr>
  <tr>
    <td colspan="2" style="text-align: center;">      <strong><br />
        <span class="style1">Aten&ccedil;&atilde;o com as perguntas e respostas secretas,             pois s&atilde;o<br />
        com
        elas que voc&ecirc;conseguir&aacute; recuperar sua senha.</span><br />
    <br />
    </strong></td>
  </tr>
</table>
<table width="499">
  <tr>
    <td width="272" class="style1"><div  id="div2"align="left">
      <div align="right">Pergunta SECRETA - </div>
    </div></td>
    <td width="215"><input type="text" name="pergunta_secreta" id="pergunta" maxlength="20" size="20" /></td>
  </tr>
  <tr>
    <td class="style1"><div  id="div2"align="left">
      <div align="right">Resposta da Pergunta SECRETA - </div>
    </div></td>
    <td><input type="text" name="resposta_secreta" id="resposta" maxlength="20" size="20" /></td>
  </tr>
  <tr>
    <td colspan="2" style="text-align: center;"><br />
      <br />
        <center><table width="275" border="0">
          <tr>
            <td width="133"><div align="center"><input type="submit" name="submit" id="registrar" value="Registrar" /></div></td>
            <td width="132"><div align="center"><input type="reset" id="registrar" value="Limpar CAMPOS" /></div></td>
          </tr>
        </table></center>
        </td>
  </tr>
</table>
</center>
</form>

<?php
$falha 
"
<center><table class='falha' border='0'>
  <tr>
    <td width='30'><center><img src=\"img/falha.png\"></center></td>
    <td>Usuario <b>"
.$_POST['login']."</b> ou E-mail <b>".$_POST['email']."</b> ja existem.</td>
  </tr>
</table></center>
"

$sucesso "
<center><table class='sucesso' border='0'>
  <tr>
    <td width='30'><center><img src=\"img/sucesso.png\"></center></td>
    <td>Usuario <b>"
.$_POST['account']."</b> Registrado com Sucesso.</td>
  </tr>
</table></center>
"
;

if(
ereg("^([a-z0-9_-])*$"$_POST['nome_completo']) &&
ereg("^([a-z0-9_-])*$"$_POST['login']) &&
ereg("^([a-z0-9_-])*$"$_POST['senha']) &&
ereg("^([a-z0-9_-])*$"$_POST['email']) &&
ereg("^([a-z0-9_-])*$"$_POST['telefone']) &&
ereg("^([a-z0-9_-])*$"$_POST['pergunta_secreta']) &&
ereg("^([a-z0-9_-])*$"$_POST['resposta_secreta'])
)
{
    if (
$page="home.php" && $_POST['login'] && strlen($_POST['login'])<16 && strlen($_POST['login'])>&& $_POST['senha'] && $_POST['senha2'] && $_POST['senha']==$_POST['senha2'])
    {    
        
$check=mysql_query("select * from accounts where login='".$_POST['login']."' or email='".$_POST['email']."'");
        
$check1=mysql_num_rows($check);
        if(
$check1>0)
        {
            echo  
$falha;
        }
        else
        {
              
mysql_query("INSERT INTO accounts (nome_completo, login, password, access_level, email, telefone, pergunta, resposta) VALUES ('".$_POST['nome_completo']."', '".$_POST['login']."', '".base64_encode(pack('H*'sha1($_POST['senha'])))."', 0, '".$_POST['email']."', '".$_POST['telefone']."', '".$_POST['pergunta_secreta']."', '".$_POST['resposta_secreta']."')"$link);
              
mysql_close($link);
             echo  
$sucesso;
        }
    }
    else
    {
      print 
'<p><b> </b></p>'.mysql_error();
    }
}
else
{
    echo 
"As limitações não foram testadas para a segurança. Se você for confiável que tido a informação correta, consultar por favor à administração. ";
}
?>

Erro
Código:

                else
                {
                {
                          mysql_query("INSERT INTO accounts (nome_completo, login, password, access_level, email, telefone, pergunta, resposta) VALUES ('".$_POST['nome_completo']."', '".$_POST['login']."', '".base64_encode(pack('H*', sha1($_POST['senha'])))."', 0, '".$_POST['email']."', '".$_POST['telefone']."', '".$_POST['pergunta_secreta']."', '".$_POST['resposta_secreta']."')", $link);
                          mysql_close($link);
                        echo  $sucesso;
                }


ManoeL-ADM 11-12-2009 06:53 PM

peço pra que alguem teste a segurança desse SCRIPT se estiver sem se possivel puder adicionar ficaria muito grato


e peço que algum progrmador de uma lida no script pra ver se tem algo sobrando porque axo que tem algo a mais que esteja atrapalhando no cadastro por causa que da erro quando vai cadastrar


ERRO

Citação:

As duas senhas não estão iguais!.


grato desde ja!


Horários baseados na GMT -3. Agora são 03:26 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0