Changeset 581 for trunk/pages/chmeil.php
- Timestamp:
- Apr 30, 2009, 1:28:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/chmeil.php
r489 r581 1 1 <?php 2 $html -> PrgStart(); 3 4 if ($player -> Check()) 2 3 $info = ''; 4 $html->PrgStart(); 5 if($player->Check()) 6 { 7 if(array_key_exists('zmenit', $_POST) and ($_POST['zmenit'] == 1)) 5 8 { 6 7 $zmenit = $_POST['zmenit'];8 if($zmenit==1){9 include("inc/db.php");10 9 $account = $_POST['acc1']; 11 10 $email1 = $_POST['email1']; 12 11 $email2 = $_POST['email2']; 13 12 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 } 28 27 29 28 30 echo " <a href=\"?page=acc\"><- Zpět do správy účtu</a><br /> 29 echo(' <a href="?page=acc"><- Zpět do správy účtu</a><br />'); 31 30 32 <b>$info</b>33 <form method= post action=\"?page=chmeil\">31 echo('<b>'.$info.'</b> 32 <form method="post" action="?page=chmeil"> 34 33 <center><h3>Změna e-mailu</h3></center> 35 34 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'].'" /> 38 37 <tr> 39 38 <td> 40 39 Starý e-mail : </td> 41 40 <td> 42 <input type= \"text\" name=\"email1\" autocomplete=\"off\"></td>41 <input type="text" name="email1" autocomplete="off" /></td> 43 42 </tr> 44 43 <tr> … … 46 45 Nový e-mail : </td> 47 46 <td> 48 <input type= \"text\" name=\"email2\" autocomplete=\"off\"></td>47 <input type="text" name="email2" autocomplete="off" /></td> 49 48 </tr> 50 49 <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> 54 53 </tr> 55 54 </table> 56 </form> 57 "; 55 </form>'); 56 } else 57 { 58 $player->LoginForm(); 58 59 } 59 else 60 { 60 $html->PrgStop(); 61 61 62 $player -> LoginForm();63 64 }65 $html -> PrgStop();66 62 ?>
Note:
See TracChangeset
for help on using the changeset viewer.