Jump to content
×
×
  • Create New...
  • 0

Php login code error


Yoyox

Question

why these code don't work ?

<div id="con-top">Panou de control</div>
<div id="con-mid">
<?PHP
  if(isset($_GET['do']) && $_GET['do']=="aktivieren" && isset($_GET['hash']) && !empty($_GET['hash'])) {
    if(strlen($_GET['hash'])==32 && $_GET['hash']!=1 && checkAnum($_GET['hash'])) {
      $cmdHash = "SELECT id,web_aktiviert FROM account.account WHERE web_aktiviert='".$_GET['hash']."' AND web_aktiviert!='1' LIMIT 1;";
      $qryHash = mysql_query($cmdHash,$sqlServ);
      
      if(mysql_num_rows($qryHash)) {
      
        $getData = mysql_fetch_object($qryHash);
        $userUpdate = "UPDATE account.account SET web_aktiviert='1',status='OK' WHERE id='".$getData->id."' LIMIT 1;";
        $updateQry = mysql_query($userUpdate,$sqlServ);
        
        if($updateQry) {
          echo'<p class="meldung">Ihr Account wurde erfolgreich aktiviert. Sie k&ouml;nnen sich nun einloggen.</p>';
          echo'<meta http-equiv="refresh" content="1; URL=index.php?s=login"> ';
        }
        else {
          echo'<p class="meldung">Query fehlgeschlagen. Bitte einen Admin kontaktieren!</p>';
        }
        
      }
      else {
        echo'<p class="meldung">Es wurde kein passender Eintrag gefunden. Aktivierung fehlgeschlagen.</p>';
      }
      
    }
    else {
      echo'<p class="meldung">Kein valider Hash!</p>';
    }
  }
 
  if(!empty($_SESSION['user_id'])) 
  {
 
    
    $cmdStats = "SELECT SUM( player.playtime ) AS ges_spielzeit, COUNT( * ) AS ges_chars, player_index.empire
    FROM player.player
    INNER JOIN player.player_index ON player_index.id = player.account_id
    WHERE player.account_id = '".$_SESSION['user_id']."'
    LIMIT 1";
    
    $qryStats = mysql_query($cmdStats,$sqlServ);
    $getStats = mysql_fetch_object($qryStats);
    
    if(!empty($getStats->empire)) {
      $reich = '<img src="img/reiche/'.$getStats->empire.'.png" title="Reich" alt="Reich"/>';
    }
    else {
      $reich='kein Reich ausgew&auml;hlt';
    }
    
    
    echo'<table>
      <tr>
        <th class="topLine">Account:</th>
        <td class="tdunkel">'.$_SESSION['user_name'].'</td>
      </tr>
      <tr>
        <th class="topLine">Reich:</th>
        <td class="thell">'.$reich.'</td>
      </tr>
      <tr>
        <th class="topLine">Charaktere:</th>
        <td class="tdunkel">'.$getStats->ges_chars.'</td>
      </tr>
      <tr>
        <th class="topLine">Gesamte Spielzeit:</th>
        <td class="thell">'.$getStats->ges_spielzeit.' Minuten</td>
      </tr>';
    $sqlAcc = "SELECT account.social_id AS loeschcode, safebox.password AS lagerpw
    FROM account.account 
    LEFT JOIN player.safebox 
    ON account.id=safebox.account_id 
    WHERE account.id='".$_SESSION['user_id']."'";
 
    $qryAcc = mysql_query($sqlAcc) or die(mysql_error());
    $getAcc = mysql_fetch_object($qryAcc);
    
    if(empty($getAcc->lagerpw)) $getAcc->lagerpw = '000000';
      
      echo'<tr>
        <th class="topLine">L&ouml;schcode:</th>
        <td class="tdunkel">'.$getAcc->loeschcode.'</td>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<center><a href="?s=prestige">Prestige System (Übersicht)</a></center>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      </tr>
    </table>';
 
  }
  else 
  {
  ?>
<h2>Login</h2>
<form action="index.php?s=login" method="POST">
  <table>
    <tr>
      <th class="topLine">User ID:</th>
      <td class="tdunkel"><input type="text" name="userid" maxlength="16" size="20"/></td>
    </tr>
    <tr>
      <th class="topLine">Passwort:</th>
      <td class="thell"><input type="password" name="userpass" maxlength="16" size="20"/></td>
    </tr>
    <tr>
      <td class="topLine" style="text-align:center;" colspan="2"><input type="submit" name="submit" value="Login"/></td>
    </tr>
  </table>
  <p><a href="index.php?s=register">Registrierung</a> &bull; <a href="index.php?s=lostpw">Passwort vergessen</a></p>
</form>
  <?PHP
  }
  ?>
</div>
<div id="con-bot"></div>
Link to comment
Share on other sites

  • Answers 5
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

5 answers to this question

Recommended Posts

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 8

      Viable protections against Layer7 attacks on servers

    2. 8

      Viable protections against Layer7 attacks on servers

    3. 8

      Viable protections against Layer7 attacks on servers

    4. 8

      Viable protections against Layer7 attacks on servers

    5. 8

      Viable protections against Layer7 attacks on servers

    6. 8

      Viable protections against Layer7 attacks on servers

    7. 8

      Viable protections against Layer7 attacks on servers

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.