Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo.
Caso seja registrado, efetue login.
Esqueceu sua senha? Clique aqui
Recomendamos o uso do Mozilla Firefox para uma melhor visualização.    


Início Postados Hoje Marcar Fóruns Como Lidos Álbums Banidos SE Team Medalhas
Voltar   Secret Experience > Área L2J > [L2J] Web Sites
Registrar Loteria VIPStaff SERegras do fórum Comunidade Arcade Postados Hoje Pesquisar Experience
   

Secret Experience.NET   Secret Experience Corporation - Welcome To The Real World
     Anúncios SE

 
 
LinkBack Ferramentas do Tópico Modos de Exibição
Prev Post Anterior   Próximo Post Next
Antigo 17-07-2009, 01:59 AM   #1
Script - Criar conta
mend3 mend3 está offline 17-07-2009, 01:59 AM

Bom, um usuário fez um pedido dele, então vou postar pra todos vocês:

Script de criação de conta com:

o Login;
o Senha;
o Repetir Senha;
o E-mail;
o Pergunta secreta;
o Resposta secreta;

Crie um arquivo em PHP (criarconta.php por exemplo), copie os códigos, cole e salve.

Basta configurar o acesso ao banco de dados.

Código PHP: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
<head>
<title>Criar conta</title>
</head>
<?php
$L2JBS_config
["mysql_host"]="localhost";        // MySQL IP
$L2JBS_config["mysql_port"]=3306;                // MySQP port
$L2JBS_config["mysql_db"]="l2jdb";            // interlude or your lineage 2 server database name
$L2JBS_config["mysql_login"]="root";            // MySQL Login name    
$L2JBS_config["mysql_password"]="root";        // MySQL Password

error_reporting(0);
?>
<?php
$L2JBS_config
["javascript_sort_method"]="bubble";
  
$link mysql_connect($L2JBS_config['mysql_host'].":".$L2JBS_config['mysql_port'], $L2JBS_config['mysql_login'], $L2JBS_config['mysql_password']);
  if (!
$link)
    die(
"Couldn't connect to MySQL");
  @
mysql_select_db($L2JBS_config['mysql_db'], $link)
    or die (
'Error '.mysql_errno().': '.mysql_error());

?>
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
<center>
<body>
<font size="4" color="red" face="Verdana"> Para seguran&ccedil;a de sua conta, preencha todos os campos do formul&aacute;rio.</font>
<form method="post" action="?ir=reg" onsubmit="return checkform(this)">
  <table>
 <tr>
  <td><b><font face="Arial" color="gold" size="3">Login</font></b></td>
  <td><font face="Arial" size="1"><b>
  <input type="text" name="account" maxlength="15" size="20" /></b></font></td>
 </tr>
 <tr>
  <td><b><font face="Arial" color="gold" size="3">E-mail</font></b></td>
  <td><font face="Arial" size="1"><b>
  <input type="text" name="email" maxlength="150" size="20" /></b></font></td>
 </tr>
 <tr>
  <td><b><font face="Arial" color="gold" size="3">Senha</font></b></td>
  <td><font face="Arial" size="1"><b>
  <input type="password" name="password" maxlength="15" size="20" /></b></font>
 </tr>
 <tr>
  <td><b><font face="Arial" color="gold" size="3">Repetir Senha</font></b></td>
  <td><font face="Arial" size="1"><b>
  <input type="password" name="password2" maxlength="15" size="20" /></b></font></td>
 </tr>
 <tr>
  <td><b><font face="Arial" color="gold" size="3">Pergunta secreta</font></b></td>
  <td><font face="Arial" size="1"><b>
  <input type="text" name="question" maxlength="15" size="20" /></b></font></td>
 </tr>
 <tr>
  <td><b><font face="Arial" color="gold" size="3">Resposta secreta</font></b></td>
  <td><font face="Arial" size="1"><b>
  <input type="password" name="answer" maxlength="15" size="20" /></b></font></td>
 </tr><br>
</table>
 <br><br>
<input type="image" src="http://www.secretwarez.net/images/confirmar.png" name="submit" value="Criar conta"/>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="/paginas/home.php"><img src="http://www.secretwarez.net/images/cancelar.png" alt="Cancelar" title="Cancelar" /></a>
</form>
</center>
<script type="text/javascript">//<![CDATA[
function isAlphaNumeric(value)
{
  if (value.match(/^[a-zA-Z0-9]+$/))
    return true;
  else
    return false;
}
function checkform(f)
{
  if (f.account.value=="")
  {
    alert("Preencha todos os campos!");
    return false;
  }
  if (!isAlphaNumeric(f.account.value))
  {
    alert("Preencha todos os campos!");
    return false;
  }
  if (f.password.value=="")
  {
    alert("Sem Senha ");
    return false;
  }
  if (!isAlphaNumeric(f.password.value))
  {
    alert("444444");
    return false;
  }
  if (f.password2.value=="")
  {
    alert("Você não repetiu a senha");
    return false;
  }
  if (f.password.value!=f.password2.value)
  {
    alert("Senhas não são iguais ");
    return false;
  }
  if (f.question.value=="")
  {
    alert("Digite uma pergunta secreta!");
    return false;
  }
  if (f.answer.value=="")
  {
    alert("Digite uma resposta secreta!");
    return false;
  }
  return true;
}
//]]></script>[/html][php]
<?php
if(ereg("^([a-zA-Z0-9_-])*$", $_POST['account']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['password']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['password2']) && ereg ("^([a-zA-Z0-9_-])*$", $_POST['question']) && ereg ("^([a-zA-Z0-9_-])*$", $_POST['answer']))
{
    if ($page="index.php" && $_POST['account'] && strlen($_POST['account'])<16 && strlen($_POST['account'])>3 && $_POST['password'] && $_POST['password2'] && $_POST['password']==$_POST['password2'])
    {    
        $check=mysql_query("select * from accounts where login='".$_POST['account']."'");
        $check1=mysql_num_rows($check);
        if($check1>0)
        {
            echo "<p clss='error'><center /><b><font color=\"red\" />Falha no Registro, Conta j&aacute; Existe .</b></p>";
        }
        $check=mysql_query("select * from accounts where email='".$_POST['email']."'");
        $check1=mysql_num_rows($check);
        if($check1>0)
        {
            echo "<p clss='error'><center /><b><font color=\"red\" />Falha no Registro, E-mail j&aacute; Existe .</b></p>";
        }
        else
        {
              mysql_query("INSERT INTO accounts (login, password, email, question, answer) VALUES ('".$_POST['account']."', '".base64_encode(pack('H*', sha1($_POST['password'])))."', '".$_POST['email']."', '".$_POST['question']."', '".$_POST['answer']."')", $link);
              mysql_close($link);
             print '<p class="error"><center><b><font color="gold" />Registro Completo<br>Conta <font color="green">'.$_POST['account'].'</font> criada com sucesso. </b></p></center>';
        }
    }
    else
    {
      print '<p class="error"><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. ";
}
?>
Gente, esqueci a SQL, quem tiver posta ae. Quem não tiver, peço que espere um pouco :D

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


 
Avatar de mend3
mend3
Membro - Coronel
Registrado em: Dec 2008
Localização: Campo Grande
Posts: 185
Pontos: 7,143, Nível: 55
Pontos: 7,143, Nível: 55 Pontos: 7,143, Nível: 55 Pontos: 7,143, Nível: 55
Atividade: 0%
Atividade: 0% Atividade: 0% Atividade: 0%

Nome Real: Victor Mendonça
Visitas: 3035
Os Seguintes 94 Usuários disseram Obrigado(a) para mend3 por gostarem deste post :
Mostrar/Ocultar lista dos que agradeceram

Links Patrocinados
 


Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Sim



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