GIF89a;
Direktori : /home/serb/public_html/ |
Current File : /home/serb/public_html/change-password.php |
<? session_start(); include("lib/globals.php"); include("lib/common.php"); include("lib/functions.php"); $page="change_pass"; ?> <? include "includes/header_top.php";?> <script language="javascript"> function validate() { if(document.chngpwd.newPassword.value=="") { alert("Enter your password"); document.chngpwd.newPassword.focus(); return false; } if(document.chngpwd.newPassword.value!=document.chngpwd.cnfPassword.value) { alert("Password not match"); document.chngpwd.cnfPassword.focus(); return false; } } </script> <? if($_POST) { $newpassword=$_POST['newPassword']; $sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'"; $res=execute_query($sql); $row=mysql_fetch_array($res); $num=mysql_num_rows($res); if($num>0) { $upd="UPDATE user_info SET password='$newpassword' WHERE userid='".$_SESSION['userid']."'"; execute_query($upd); ?> <script language="javascript"> location.href="change-password.php?msg=1"; </script> <? } } ?> <body> <? include "includes/header.php";?> <div class="hdr_foo"> <div class="hrd_ftmenu"> </div> </div> <div class="main_bg"> <div style="height:32px;"></div> <div style="width:1000px; margin:0 auto;"> <div class="menuleft_contain"> <? include "includes/acount_leftcontent.php";?> </div> <div class="acountright_contain"> <? $sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'"; $res=execute_query($sql); $row=mysql_fetch_array($res); $num=mysql_num_rows($res); ?> <div class="acccmid1_header">Change Password</div> <div class="accountrightct_mid"> <div class="small_space"></div> <div class="profile_data"> <?php /*?><? $sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'"; $res=execute_query($sql); $row=mysql_fetch_array($res); $num=mysql_num_rows($res); ?><?php */?> <? if($_GET['msg']==1){ ?> <p style="color:#ff9131; font-family:'Open Sans',sans-serif; text-align:center;">Your Password Has Changed.</p> <? } ?> <form action="<?=$_SERVER['PHP_SELF'] ?>" method="post" name="chngpwd" onSubmit="return validate();"> <table border="0" cellpadding="0" cellspacing="7" align="center" style="margin:0 auto;"> <tr height="5"></tr> <tr> <td class="logintext">New Password :</td> <td><input name="newPassword" id="newpassword" class="main_input3333" type="password"></td> </tr> <tr> <td class="logintext">Confirm Password :</td> <td><input name="cnfPassword" id="conpassword" class="main_input3333" type="password"></td> </tr> <tr height="15"></tr> <tr> <td></td> <td><input type="image" src="images/submit.png" /></td> </tr> <tr height="10"></tr> </table> </form> <br class="spacer" /> </div> <br class="spacer" /> </div> </div> <br class="spacer" /> </div> <br/> </div> <? include "includes/footer.php";?>