Jump to content

Parse error: syntax error, unexpected T_ELSE in C:\wamp\www\pages\register.php


Ramz0n

Recommended Posts

I googled it and found similar problems but couldnt find out how to fix it..

:shrug:

 

Parse error: syntax error, unexpected T_ELSE in C:\wamp\www\pages\register.php on line 84:

<h2>Registo</h2>
<?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']=="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)) 
  {

        $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']." Registo";
          $email = $serverSettings['reg_mail'];
          $empfaenger = $_POST['email'];
          $mail_body = "Olá ".$_POST['uname'].",
          
          O seu registo no ".$serverSettings['titel']." foi efectuado com sucesso! Agora para poder jogar no nosso servidor, tem que activar a conta.
          Que deve activa-la no seguinte link:
          
          ".$serverSettings['url']."/index.php?s=login&do=aktivieren&hash=".$aktivHash."
          
          Os seus dados são:
          Nomme da conta: ".$_POST['account']."
          Password: ".$userpass."
          
          Codigo de apagar a personagem: ".$lcode."
          Pergunta Secreta: ".$sFrage[$sfNum]."
          Resposta: ".$_POST['sicherheitsa']."
          
          Bom jogo,
          
          A Equipa do ".$serverSettings['titel']."
          
          
		Este endereço de e-mail foi gerado automaticamente. Por favor, não responda para este endereço de e-mail.";
          $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">Account erfolgreich angelegt. Sie können sich nun anmelden.</p>';
          }
          
        }
        else {
          echo'<p class="meldung">Registrierung fehlgeschlagen: Der Account existiert bereits.</p>';
        }
  
      //line 84 //    else {
        echo'<p class="meldung">Registrierung fehlgeschlagen: bitte alle Felder richtig angeben</p>';
      }
  ?>
    <p>Todos os campos devem ser devidamente preenchidos, caso conter dados falsos a conta será banida.
<?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="index.php?s=register" method="POST">
      <table>
        <tr>
          <th class="topLine">Nome da conta:</th>
          <td class="tdunkel"><input type="text" name="account" maxlength="16" size="16"/> 8-16 Caracteres (apenas a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Nome real:</th>
          <td class="thell"><input type="text" name="uname" maxlength="16" size="16"/> 3-20 Caracteres (apenas a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Password:</th>
          <td class="tdunkel"><input type="password" name="pass" maxlength="16" size="16"/> 8-16 Caracteres (apenas a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Repita a 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">Repita o E-Mail:</th>
          <td class="thell"><input type="text" name="email2" maxlength="50" size="25"/></td>
        </tr>
        <tr>
          <th class="topLine">Codigo de apagar a perssonagem:</th>
          <td class="tdunkel"><input type="text" name="loeschcode" maxlength="7" size="7"/> 7 Caracteres (apenas a-Z,0-9)</td>
        </tr>
        <tr>
          <th class="topLine">Pergunta Secreta:</th>
          <td class="thell">
            <select name="sicherheitsf">
              <?PHP
                foreach($sFrage AS $fragew => $frage) {
                  echo'<option value="'.$fragew.'">'.$frage.'</option>';
                }
              ?>
            </select>
            <input type="text" name="sicherheitsa" maxlength="16" size="16"/> 3-16 Caracteres (apenas 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" value="Registar"/> • <input type="reset" value="Cancelar"/></th>
        </tr>
      </table>
    </form> 
  <?PHP
  }
  else {
    echo'<p class="meldung">Die Registration ist deaktiviert oder Sie sind bereits angemeldet. Es kann kein weiterer Account erstellt werden.</p>'
  }
?>

 

 

Thanks ;D

Link to comment
Share on other sites

You have two errors I noticed immediately

 

First (double curly brace):

if($serverSettings['register_on'] && (!isset($_SESSION['user_admin']) &&  !checkInt($_SESSION['user_admin']) && !$_SESSION['user_admin']>=0)) { {

 

should be:

if($serverSettings['register_on'] && (!isset($_SESSION['user_admin']) &&  !checkInt($_SESSION['user_admin']) && !$_SESSION['user_admin']>=0)) {

 

and Second (missing semi-colon):

echo'<p class="meldung">Die Registration ist deaktiviert oder Sie sind bereits angemeldet. Es kann kein weiterer Account erstellt werden.</p>'

 

should be:

echo '<p class="meldung">Die Registration ist deaktiviert oder Sie sind bereits angemeldet. Es kann kein weiterer Account erstellt werden.</p>';

 

Syntax errors are what they say, syntax errors. In most cases they are missing braces, semi-colons, parantheses, quotes, etc.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.