antiblock
diamwall
  • Chatbox

    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
Anplificador

Problema Com Registo De Conta

Question

Boas cada vez que tento criar qualquer conta que seja no meu servidor da-me o seguinte erro:

 

"Registo falhou: A conta já existe."

   

 

Atenção ->  Não é do site pois ele conectado a outra BD funciona perfeitamente.

 

Alguém me poderia ajudar?

 

                                                                                                                          

 

 

Share this post


Link to post
Share on other sites

11 answers to this question

  • 0

Tens de adicionar os campos, podes usar estes comando.

 

ALTER TABLE account.account ADD COLUMN `coins` int(11) NULL DEFAULT 0;
ALTER TABLE account.account ADD COLUMN `web_aktiviert` varchar(32) NULL DEFAULT 0;

Share this post


Link to post
Share on other sites
antiblock
Elveron
  • 0

Coloca aqui o código da tua página de registo sff.

E se possível um print da tua tabela account, só é preciso o esquema.

Share this post


Link to post
Share on other sites
  • 0

 

Registo</h3>

        </div>
        <div id="middle_content" style="margin:1px">
<p>
<?PHP
  
  $regCoins = 0; // Startcoins
  
  $laufZeit = 365; //Tage autoloot,safebox
  $calcLZ = (60*60*24)*365;
  $expireStamp = time()+$calcLZ;
  $expireDate = date("Y-m-d H:i:s",$expireStamp);
  
  if($serverSettings['register_on'] && (!isset($_SESSION['user_admin']) && !checkInt($_SESSION['user_admin']) && !$_SESSION['user_admin']>=0)) {
  
    if(isset($_POST['submit']) && $_POST['submit']=="Registar") {
      if((checkAnum($_POST['account']) && strlen($_POST['account'])>=4 && strlen($_POST['account'])<=16) && checkAnum($_POST['pass'])  && strlen($_POST['pass'])>=4 && strlen($_POST['pass2'])<=16 && !empty($_POST['pass2']) && (checkName($_POST['uname']) && strlen($_POST['uname'])>=3 && strlen($_POST['uname'])<=20) && $_POST['pass']==$_POST['pass2'] && checkMail($_POST['email']) && strlen($_POST['email'])<=40 && $_POST['captcha']==$_SESSION['captcha_id'] && $_POST['email']==$_POST['email2'] && (checkAnum($_POST['sicherheitsa']) && strlen($_POST['sicherheitsa'])>=3 && strlen($_POST['sicherheitsa'])<=16) && checkInt($_POST['sicherheitsf']) && (checkAnum($_POST['loeschcode']) && strlen($_POST['loeschcode'])==7)) {
 
        $hashSF = md5($_POST['sicherheitsa']);
        $sfNum = mysql_real_escape_string($_POST['sicherheitsf']);
        $lcode = mysql_real_escape_string($_POST['loeschcode']);
        
        $zuFall = rand(99999,999999999);
        $userpass=mysql_real_escape_string($_POST['pass']);
        
        $aktivHash = ($serverSettings['mail_activation']) ? md5($zuFall):'';
        $accountStatus = ($serverSettings['mail_activation']) ? 'BLOCK':'OK';
        
        $sqlCmd = "INSERT INTO account.account 
        (login,password,real_name,email,social_id,question1,answer1,create_time,status,coins,autoloot_expire,safebox_expire,web_aktiviert) 
        VALUES 
        ('".$_POST['account']."',PASSWORD('".$userpass."'),'".mysql_real_escape_string($_POST['uname'])."','".mysql_real_escape_string($_POST['email'])."','".$lcode."','".$sfNum."','".$hashSF."','".$sqlZeit."','".$accountStatus."','".$regCoins."','".$expireDate."','".$expireDate."','".$aktivHash."')";
        $sqlQry = mysql_query($sqlCmd,$sqlServ);
        if($sqlQry) {
          
          
          $absender = $serverSettings['titel']." Registration";
          $email = $serverSettings['reg_mail'];
          $empfaenger = $_POST['email'];
          $mail_body = "Hallo ".$_POST['uname'].",
          
          deine Registration auf ".$serverSettings['titel']." war erfolgreich! Um auch auf dem Server spielen zu können, musst du deinen Account aktivieren.
          Das kannst du über den folgenden Link tun:
          
          ".$serverSettings['url']."/?p=login&do=aktivieren&hash=".$aktivHash."
          
          Deine Daten sind:
          Account: ".$_POST['account']."
          Passwort: ".$userpass."
          
          Löschcode: ".$lcode."
          Sicherheitsfrage: ".$sFrage[$sfNum]."
          Antwort: ".$_POST['sicherheitsa']."
          
          Viel Spaß beim Spielen,
          
          Dein ".$serverSettings['titel']."-Team
          
          
          Diese E-Mail wurde automatisch generiert. Bitte keine Antworten an diese Adresse schicken.";
          $titel = "Registrierung auf ".$serverSettings['titel'];
          
          $header = "X-Priority: 3\n";
          $header .= "X-Mailer: ".$serverSettings['titel']." Homepage Mailer\n";
          $header .= "MIME-Version: 1.0\n";
          $header .= "From: ".$absender." <".$serverSettings['reg_mail'].">\n";
          $header .= "Reply-To: ".$serverSettings['reg_mail']."\n";
          $header .= "Content-Type: text/plain; charset=iso-8859-1\n";
          
          
          if($serverSettings['mail_activation']) {
            mail($empfaenger, $titel, $mail_body, $header);
            echo'<p class="meldung">Account erfolgreich angelegt. Bitte überprüfen Sie Ihr Postfach, um die Registrierung zu bestätigen.</p>';
          }
          else {
            echo'<p class="meldung">Conta criada com sucesso.</p>';
          }
          
        }
        else {
          echo'<p class="meldung">Registo falhou: A conta já existe.</p>';
        }
        
      }
      else {
        echo'<p class="meldung">Registo falhou: Especifica todos os campos corretamente.</p>';
      }
    }
  ?>
    <p>Todos os campos tem de ser preenchidos obrigatoriamente.<?PHP if($serverSettings['mail_activation']) { echo'<br/><b>Der Account wird per E-Mail aktiviert, also eine richtige E-Mail eingeben!</b>'; } ?></p>
    <form action="?p=register" method="POST">
      <table>
        <tr>
          <th class="topLine">Conta:</th>
          <td class="tdunkel"><input type="text" name="account" maxlength="16" size="16"/> 4-16 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Nome:</th>
          <td class="thell"><input type="text" name="uname" maxlength="16" size="16"/> 3-20 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Password:</th>
          <td class="tdunkel"><input type="password" name="pass" maxlength="16" size="16"/> 4-16 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Repetir Password:</th>
          <td class="thell"><input type="password" name="pass2" maxlength="16" size="16"/></td>
        </tr>
        <tr>
          <th class="topLine">E-Mail:</th>
          <td class="tdunkel"><input type="text" name="email" maxlength="50" size="25"/> max. 40 Caracteres</td>
        </tr>
        <tr>
          <th class="topLine">Repetir E-Mail:</th>
          <td class="thell"><input type="text" name="email2" maxlength="50" size="25"/></td>
        </tr>
        <tr>
          <th class="topLine">Codigo:</th>
          <td class="tdunkel"><input type="text" name="loeschcode" maxlength="7" size="7"/> 7 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Pergunta:</th>
          <td class="thell">
            <select name="sicherheitsf">
              <?PHP
                foreach($sFrage AS $fragew => $frage) {
                  echo'<option value="'.$fragew.'">'.$frage.'</option>';
                }
              ?>
            </select>
</td>
</tr>
<tr>
 <th>Resposta:</th>
 <td>
            <input type="text" name="sicherheitsa" maxlength="16" size="16"/> 3-16 Caracteres (entre  a-Z,0-9)
          </td>
        </tr>
        <tr>
          <th class="topLine">Captcha:</th>
          <td class="tdunkel"><img src="./captcha/captcha.php" title="Captcha"/> <input type="text" name="captcha" maxlength="5" size="5"/></td>
        </tr>
        <tr>
          <th class="topLine" style="text-align:center;" colspan="2"><input type="submit" name="submit" id="blogin" value="Registar"/> <input type="reset" id="blogin" value="Resetar"/></th>
        </tr>
      </table>
    </form>
  <?PHP
  }
  else {
    echo'<p class="meldung">Já estas registado.</p>';
  }
?>
</p>

 

 

Quando te referiste a esquema espero ser algo disto ->

 

t4vhunwpit0gburxssl3.jpg

Share this post


Link to post
Share on other sites
  • 0

Sim é isso, porem a mensagem de erro, está no lugar errado.

Share this post


Link to post
Share on other sites
  • 0

E?

 

Mesmo que tivesse errado ele criava a conta na mesma.

Share this post


Link to post
Share on other sites
  • 0

Tenta isto:

 

Registo</h3>

        </div>
        <div id="middle_content" style="margin:1px">
<p>
<?PHP
  
  $regCoins = 0; // Startcoins
  
  $laufZeit = 365; //Tage autoloot,safebox
  $calcLZ = (60*60*24)*365;
  $expireStamp = time()+$calcLZ;
  $expireDate = date("Y-m-d H:i:s",$expireStamp);
  
  if($serverSettings['register_on'] && (!isset($_SESSION['user_admin']) && !checkInt($_SESSION['user_admin']) && !$_SESSION['user_admin']>=0)) {
  
    if(isset($_POST['submit']) && $_POST['submit']=="Registar") {
      if((checkAnum($_POST['account']) && strlen($_POST['account'])>=4 && strlen($_POST['account'])<=16) && checkAnum($_POST['pass'])  && strlen($_POST['pass'])>=4 && strlen($_POST['pass2'])<=16 && !empty($_POST['pass2']) && (checkName($_POST['uname']) && strlen($_POST['uname'])>=3 && strlen($_POST['uname'])<=20) && $_POST['pass']==$_POST['pass2'] && checkMail($_POST['email']) && strlen($_POST['email'])<=40 && $_POST['captcha']==$_SESSION['captcha_id'] && $_POST['email']==$_POST['email2'] && (checkAnum($_POST['sicherheitsa']) && strlen($_POST['sicherheitsa'])>=3 && strlen($_POST['sicherheitsa'])<=16) && checkInt($_POST['sicherheitsf']) && (checkAnum($_POST['loeschcode']) && strlen($_POST['loeschcode'])==7)) {
 
        $hashSF = md5($_POST['sicherheitsa']);
        $sfNum = mysql_real_escape_string($_POST['sicherheitsf']);
        $lcode = mysql_real_escape_string($_POST['loeschcode']);
        
        $zuFall = rand(99999,999999999);
        $userpass=mysql_real_escape_string($_POST['pass']);
        
        $aktivHash = ($serverSettings['mail_activation']) ? md5($zuFall):'';
        $accountStatus = ($serverSettings['mail_activation']) ? 'BLOCK':'OK';
        
 
 
$username = mysql_real_escape_string($_POST['account']);
$name = mysql_real_escape_string($_POST['uname']);
$email = mysql_real_escape_string($_POST['email']);
$sqlCmd = mysql_query("INSERT INTO account (login,password,real_name,social_id,email,create_time,question1,answer1,status,coins,autoloot_expire,safebox_expire,web_aktiviert)
VALUES
('".$username."',PASSWORD('".$userpass."'),'".$name."','".$lcode."','".$mail."','".date('Y-m-d H:i:s',$dateline)."','".$hashSF."','".$sfNum."','".$accountStatus."','".$regCoins."','".$expireDate."','".$expireDate."','".$aktivHash."')");
if($sqlCmd) {
          $absender = $serverSettings['titel']." Registration";
          $email = $serverSettings['reg_mail'];
          $empfaenger = $_POST['email'];
          $mail_body = "Hallo ".$_POST['uname'].",
          
          deine Registration auf ".$serverSettings['titel']." war erfolgreich! Um auch auf dem Server spielen zu können, musst du deinen Account aktivieren.
          Das kannst du über den folgenden Link tun:
          
          ".$serverSettings['url']."/?p=login&do=aktivieren&hash=".$aktivHash."
          
          Deine Daten sind:
          Account: ".$_POST['account']."
          Passwort: ".$userpass."
          
          Löschcode: ".$lcode."
          Sicherheitsfrage: ".$sFrage[$sfNum]."
          Antwort: ".$_POST['sicherheitsa']."
          
          Viel Spaß beim Spielen,
          
          Dein ".$serverSettings['titel']."-Team
          
          
          Diese E-Mail wurde automatisch generiert. Bitte keine Antworten an diese Adresse schicken.";
          $titel = "Registrierung auf ".$serverSettings['titel'];
          
          $header = "X-Priority: 3\n";
          $header .= "X-Mailer: ".$serverSettings['titel']." Homepage Mailer\n";
          $header .= "MIME-Version: 1.0\n";
          $header .= "From: ".$absender." <".$serverSettings['reg_mail'].">\n";
          $header .= "Reply-To: ".$serverSettings['reg_mail']."\n";
          $header .= "Content-Type: text/plain; charset=iso-8859-1\n";
          
          
          if($serverSettings['mail_activation']) {
            mail($empfaenger, $titel, $mail_body, $header);
            echo'<p class="meldung">Account erfolgreich angelegt. Bitte überprüfen Sie Ihr Postfach, um die Registrierung zu bestätigen.</p>';
          }
          else {
            echo'<p class="meldung">Conta criada com sucesso.</p>';
          }
          
        }
        else {
          echo'<p class="meldung">Ocorreu um erro.</p>';
        }
        
      }
      else {
        echo'<p class="meldung">Registo falhou: Especifica todos os campos corretamente.</p>';
      }
    }
  ?>
    <p>Todos os campos tem de ser preenchidos obrigatoriamente.<?PHP if($serverSettings['mail_activation']) { echo'<br/><b>Der Account wird per E-Mail aktiviert, also eine richtige E-Mail eingeben!</b>'; } ?></p>
    <form action="?p=register" method="POST">
      <table>
        <tr>
          <th class="topLine">Conta:</th>
          <td class="tdunkel"><input type="text" name="account" maxlength="16" size="16"/> 4-16 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Nome:</th>
          <td class="thell"><input type="text" name="uname" maxlength="16" size="16"/> 3-20 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Password:</th>
          <td class="tdunkel"><input type="password" name="pass" maxlength="16" size="16"/> 4-16 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Repetir Password:</th>
          <td class="thell"><input type="password" name="pass2" maxlength="16" size="16"/></td>
        </tr>
        <tr>
          <th class="topLine">E-Mail:</th>
          <td class="tdunkel"><input type="text" name="email" maxlength="50" size="25"/> max. 40 Caracteres</td>
        </tr>
        <tr>
          <th class="topLine">Repetir E-Mail:</th>
          <td class="thell"><input type="text" name="email2" maxlength="50" size="25"/></td>
        </tr>
        <tr>
          <th class="topLine">Codigo:</th>
          <td class="tdunkel"><input type="text" name="loeschcode" maxlength="7" size="7"/> 7 Caracteres (entre  a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Pergunta:</th>
          <td class="thell">
            <select name="sicherheitsf">
              <?PHP
                foreach($sFrage AS $fragew => $frage) {
                  echo'<option value="'.$fragew.'">'.$frage.'</option>';
                }
              ?>
            </select>
</td>
</tr>
<tr>
 <th>Resposta:</th>
 <td>
            <input type="text" name="sicherheitsa" maxlength="16" size="16"/> 3-16 Caracteres (entre  a-Z,0-9)
          </td>
        </tr>
        <tr>
          <th class="topLine">Captcha:</th>
          <td class="tdunkel"><img src="./captcha/captcha.php" title="Captcha"/> <input type="text" name="captcha" maxlength="5" size="5"/></td>
        </tr>
        <tr>
          <th class="topLine" style="text-align:center;" colspan="2"><input type="submit" name="submit" id="blogin" value="Registar"/> <input type="reset" id="blogin" value="Resetar"/></th>
        </tr>
      </table>
    </form>
  <?PHP
  }
  else {
    echo'<p class="meldung">Já estas registado.</p>';
  }
?>

</p>  

Share this post


Link to post
Share on other sites
  • 0

A estrutura da tabela deve ser diferente à que está planeada no código quase de certeza.

Tens que reescrever isso e ver se está de acordo com a tua estrutura.

Share this post


Link to post
Share on other sites
  • 0

Já reparaste na tabela se tem as colunas todas? ( verifica a coins e a web_aktiviert )

Share this post


Link to post
Share on other sites
  • 0

Realmente essas 2 não existem ai já começa a fazer algum sentido alguém experte em PHP para me ajudar?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this