Changeset 581 for trunk/pages/chmeil.php


Ignore:
Timestamp:
Apr 30, 2009, 1:28:25 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Chybová některých chybových hlášení.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/chmeil.php

    r489 r581  
    11<?php
    2 $html -> PrgStart();
    3  
    4  if ($player -> Check())
     2
     3$info = '';
     4$html->PrgStart();
     5if($player->Check())
     6{
     7  if(array_key_exists('zmenit', $_POST) and ($_POST['zmenit'] == 1))
    58  {
    6 
    7 $zmenit = $_POST['zmenit'];
    8 if($zmenit==1){
    9     include("inc/db.php");
    109    $account = $_POST['acc1'];
    1110    $email1 = $_POST['email1'];
    1211    $email2 = $_POST['email2'];
    1312
    14     mysql_connect($db_server, $db_user, $db_pass);
    15         mysql_select_db($db_realmd);
    16         $email_check = mysql_num_rows(mysql_query("select id from account where username='$account' and email='$email1'"));
    17         if($email_check!=0):
    18         $email_update = mysql_query("update account set email='$email2' where username='$account'");
    19         if($email_update):
    20         $info = "<font color=green><strong>Email byl vpořádku změněn!</strong></font>";
    21         else:
    22     $info = "<font color=red><strong>Email se nepodařilo změnit!</strong></font>";
    23         endif;
    24         else:
    25         $info = "<font color=red><b>Zadali jste špatný stávající email nebo neexistující account!</b></font>";
    26         endif;
    27 }
     13          $db->select_db($Config['Mangos']['DatabaseRealmd']);
     14    $DbResult = $db->query('select id from account where username="'.$account.'" and email="'.$email1.'"');
     15          if($DbResult->num_rows > 0)
     16    {
     17            $email_update = $db->query('update account set email="'.$email2.'" where username="'.$account.'"');
     18            if($email_update)
     19      {
     20              $info = '<font color="green"><strong>Email byl vpořádku změněn!</strong></font>';
     21            } else
     22      {
     23        $info = '<font color="red"><strong>Email se nepodařilo změnit!</strong></font>';
     24            }
     25          } else $info = '<font color=red><b>Zadali jste špatný stávající email nebo neexistující účet!</b></font>';
     26  }
    2827
    2928
    30 echo "&nbsp;<a href=\"?page=acc\">&lt;- Zpět do správy účtu</a><br />
     29  echo('&nbsp;<a href="?page=acc">&lt;- Zpět do správy účtu</a><br />');
    3130
    32 <b>$info</b>
    33 <form method=post action=\"?page=chmeil\">
     31  echo('<b>'.$info.'</b>
     32<form method="post" action="?page=chmeil">
    3433<center><h3>Změna e-mailu</h3></center>
    3534
    36 <table align=\"center\">
    37  <input type=\"hidden\" name=\"acc1\" value='".$_SESSION["UserName"]."'>
     35<table align="center">
     36 <input type="hidden" name="acc1" value="'.$_SESSION['UserName'].'" />
    3837  <tr>
    3938    <td>
    4039      Starý e-mail : </td>
    4140    <td>
    42       <input type=\"text\" name=\"email1\" autocomplete=\"off\"></td>
     41      <input type="text" name="email1" autocomplete="off" /></td>
    4342  </tr>
    4443  <tr>
     
    4645      Nový e-mail : </td>
    4746    <td>
    48       <input type=\"text\" name=\"email2\" autocomplete=\"off\"></td>
     47      <input type="text" name="email2" autocomplete="off" /></td>
    4948  </tr>
    5049  <tr>
    51     <td colspan=\"2\" align=\"right\">
    52         <input type=hidden name=zmenit value='1'>
    53       <input type=\"submit\" value=\"Změnit\" name=\"change\"></td>
     50    <td colspan="2" align="right">
     51        <input type="hidden" name=zmenit value="1" />
     52      <input type="submit" value="Změnit" name="change" /></td>
    5453  </tr>
    5554</table>
    56 </form>
    57 ";
     55</form>');
     56} else
     57{
     58  $player->LoginForm();
    5859}
    59 else
    60 {
     60$html->PrgStop();
    6161
    62 $player -> LoginForm();
    63 
    64 }
    65 $html -> PrgStop();
    6662?>
Note: See TracChangeset for help on using the changeset viewer.