Jump to content

Script de registro...


Recommended Posts

Buenas, tengo el siguiente problema... pongo todo los datos para registrar una cuenta en la web y cuando le doy a registrar recarga la pagina pero no me registra la cuenta, no hace nada :S

 

Si alguien podria arreglarmelo se lo agradeceria!

 

Aqui le dejo el script de registro...

 

 

 

<div class="main main_title">
			>> Registrarse
		</div><div class="main main_content">
<?PHP
  
  $regCoins = 0;
  
  $laufZeit = 365;
  $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']=="Registrieren") {
      if((checkAnum($_POST['account']) && strlen($_POST['account'])>=8 && strlen($_POST['account'])<=16) && checkAnum($_POST['pass']) && strlen($_POST['pass'])>=8 && 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) && isset($_POST['agb']) && $_POST['sicherheitsa']==$_POST['sicherheitsa2']) {

        $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,gold_expire,silver_expire,money_drop_rate_expire,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."','".$expireDate."','".$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']." fue un exito! Para jugar en el servidor, usted tiene que activar su cuenta.
          Que se puede utilizar el siguiente enlace para activarla:
          
          ".$serverSettings['url']."/index.php?s=login&do=aktivieren&hash=".$aktivHash."
          
          Sus datos:
          Usuario: ".$_POST['account']."
          Clave: ".$userpass."
          
          Codigo de borrado: ".$lcode."
          Pregunta secreta: ".$sFrage[$sfNum]."
          Respuesta: ".$_POST['sicherheitsa']."
          
          Disfruta de Zelenium2,
          
          Si ".$serverSettings['titel']."- Team
          
          
          Este mensaje se ha generado automaticamente. Por favor enviar cualquier respuesta a esta direccion.";
          $titel = "inscripcion en ".$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'<div class="online"><center>La cuenta se invirtio con exito. Por favor, revise su casilla de correo para confirmar el registro.</center></div><hr class="ranking_hr" />';
          }
          else {
            echo'<div class="online"><center>Se guardo con exito la cuenta registrada, ya puedes acceder ahora.</center></div><hr class="ranking_hr" />';
          }
          
        }
        else {
          echo'<div class="offline"><center>La cuenta ya existe, prueba con otro usuario.</center></div><hr class="ranking_hr" />';
        }
        
      }
      else {
        echo'<div class="offline"><center>Porfavor, rellena todos los campos correctamente...</center></div><hr class="ranking_hr" />';
      }
    }
  ?>
<form id="regis tooltip" action="index.php?s=register" method="POST">
      <table width="100%" style="font-size:12px;">
        <tr>
          <th width="150" class="topLine">Usuario:</th>
          <td width="215" class="tdunkel"><input type="text" class="Input_ID_Text2" name="account" maxlength="16" size="16" title="8-16 Caracteres (nur a-Z,0-9)"/></td>
          <td width="235" class="info">* 8-16 Caracteres (a-Z,0-9)</th>
        </tr>
        <tr>
          <th class="topLine">Clave:</th>
          <td class="tdunkel"><input type="password" class="Input_PW_Text2" name="pass" maxlength="16" size="16" title="8-16 Caracteres (a-Z,0-9)"/></td>
          <td class="info">* 8-16 Caracteres (a-Z,0-9)</th>
        </tr>
        <tr>
          <th class="topLine">Repetir Clave:</th>
          <td class="thell"><input type="password" class="Input_PW_Text2" name="pass2" maxlength="16" size="16" title="8-16 Caracteres (a-Z,0-9)"/></td>
		  <td class="info">* Repita su clave</th>
        </tr>
        <tr>
          <th class="topLine">E-mail:</th>
          <td class="tdunkel"><input type="text" class="Input_ID_Text2" name="email" maxlength="50" size="20" title="Geben sie eine gültige eMail ein"/></td>
		  <td class="info">* Escriba un email valido</th>
        </tr>
        <tr>
          <th class="topLine">Repetir E-mail:</th>
          <td class="thell"><input type="text" class="Input_ID_Text2" name="email2" maxlength="50" size="20" title="Wiederhole deine eMail"/></td>
		  <td class="info">* Repita su E-mail</th>
        </tr>
        <tr>
          <th class="topLine">Nombre:</th>
          <td class="thell"><input type="text" class="Input_ID_Text2" name="uname" maxlength="16" size="16" title="3-20 Caracteres (a-Z,0-9)"/></td>
          <td class="info">* 3-20 Caracteres (a-Z,0-9)</th>
        </tr>
        <tr>
          <th class="topLine">Cod. de borrado:</th>
          <td class="tdunkel"><input type="text" class="Input_ID_Text2" name="loeschcode" maxlength="7" size="7" title="7 Caracteres (a-Z,0-9)"/></td>
          <td class="info">* 7 Caracteres (a-Z,0-9)</th>
        </tr>
        <tr>
          <th class="topLine">Pregunta:</th>
          <td class="thell">
            <select name="sicherheitsf" title="Wählen sie eine Frage aus">
            	<?PHP
                foreach($sFrage AS $fragew => $frage) {
                  echo'<option value="'.$fragew.'">'.$frage.'</option>';
                }
              ?>
            </select>
       		</td>
        </tr>
        <tr>
        	<th>Respuesta:</th>
        	<td><input type="text" name="sicherheitsa" class="Input_ID_Text2" maxlength="16" size="16" title="Responde a la pregunta de seguridad"/></td>
			<td class="info">* Responde a la pregunta de seguridad</th>
        </tr>
        <tr>
        	<th>
            	Repetir Respuesta:
            </th>
        	<td>
        		<input type="text" name="sicherheitsa2" class="Input_ID_Text2" maxlength="16" size="16" title="Repite la respuesta de seguridad"/>
       		</td>
			<td class="info">* Repite la respuesta de seguridad</th>
        </tr>
        <tr>
          <th class="topLine">Captcha: <img src="./captcha/captcha.php" title="Captcha"/></th>
          <td class="tdunkel"><input type="text" name="captcha" class="Input_ID_Text2" maxlength="5" size="5" title="Revisa bien los numeros"/></td>
        </tr>
        <tr>
         <td class="topLine" style="text-align:center;" colspan="2"><input type="checkbox" name="agb" title="ACEPTO LAS REGLAS"> ACEPTO LAS REGLAS .</th>
        </tr>
        <tr>
          <th class="topLine" style="text-align:center;" colspan="3"><input type="submit" name="submit" class="btn" value="Registrarse"/></th>
        </tr>
      </table>
    </form>
  <?PHP
  }
  else {
    echo'<p class="offline">El registro esta deshabilitado o esa cuenta ya esta creada. No puede haber ninguna otra cuenta igual.</p>';
  }
?>
    </div>
		<div class="main main_bottom">
		</div> 

 

 

Link to comment
Share on other sites

Bueno te explico cuando cambias el boton submit el value debe ser justamente igual en esta parte

 

if(isset($_POST['submit']) && $_POST['submit']=="Registrieren") {

 

Entonces debes colocarlo asi

 

if(isset($_POST['submit']) && $_POST['submit']=="Registrarse") {

 

y porque? pues simple y sencillamente porque cuando traduciste el codigo le pusiste asi en el boton submit en su value="Registrarse" 

 

<th class="topLine" style="text-align:center;" colspan="3"><input type="submit" name="submit" class="btn" value="Registrarse"/></th>

 

------------------------- OTRA COSA IMPORTANTE --------------------------

debes fijarte si el script te dirige al mismo documento es decir la url del codigo de registro ya que si no es asi no ejecutara el codigo en la parte del action="debe estar la misma url de la pagina de registro" 

 

<form id="regis tooltip" action="index.php?s=register" method="POST">

 

Saludos espero te sirva sino cualquier cosa hazlo saber y con gusto te ayudo aqui en el foro.

Link to comment
Share on other sites

Bueno te explico cuando cambias el boton submit el value debe ser justamente igual en esta parte

 

if(isset($_POST['submit']) && $_POST['submit']=="Registrieren") {

 

Entonces debes colocarlo asi

 

if(isset($_POST['submit']) && $_POST['submit']=="Registrarse") {

 

y porque? pues simple y sencillamente porque cuando traduciste el codigo le pusiste asi en el boton submit en su value="Registrarse" 

 

<th class="topLine" style="text-align:center;" colspan="3"><input type="submit" name="submit" class="btn" value="Registrarse"/></th>

 

------------------------- OTRA COSA IMPORTANTE --------------------------

debes fijarte si el script te dirige al mismo documento es decir la url del codigo de registro ya que si no es asi no ejecutara el codigo en la parte del action="debe estar la misma url de la pagina de registro" 

 

<form id="regis tooltip" action="index.php?s=register" method="POST">

 

Saludos espero te sirva sino cualquier cosa hazlo saber y con gusto te ayudo aqui en el foro.

Muchas gracias ! lo solucione! :D

Link to comment
Share on other sites

  • Dilong locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...