<html lang="pt">
<head>
<meta name="description" content="Lucas Thompson" />
<title>Mu Site - WEB</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<? session_start();
include 'cnn.php';
include 'estilo.css';
include 'configs/conf_extras.php';
include 'configs/conf_reset.php';
@$login = $_SESSION['login'];
@$senha = $_SESSION['senha'];
if(!isset($_SESSION['login'])) { echo "Para acessar essa pagina é preciso esta logado!"; }
else{
$vip=mssql_fetch_row(mssql_query("select vip from memb_info where memb___id='".$login."'"));
?>
</head>

<body>
<table width="510" border="2" background="imagens/bg2.jpg">
  <tr>
    <th scope="col"><div align="left">
      <table width="510" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="30"><img src="imagens/mu.gif" alt="" width="30" height="30"></td>
          <td width="480" background="imagens/mu_back.png">&nbsp;&nbsp;&nbsp;<strong>Mudar Senha</strong></td>
        </tr>
      </table>
    </div>
      <br>
      <br>
      <form name="form1" method="post" action="">
        <table width="95%" border="0" cellspacing="2" cellpadding="0">
          <tr>
            <td width="20%">Nova senha: </td>
            <td width="80%"><label>
              <input name="nova" type="password" id="nova" maxlength="10">
            </label></td>
          </tr>
          <tr>
            <td><label></label></td>
            <td><input name="prossegue" type="submit" class="submit" id="prossegue" value="MUDAR"></td>
          </tr>
        </table>
      </form>
      <br>
      <a href="javascript:history.back(-1);"><p align="left">&lt;&lt; voltar </p></a> </th>
  </tr>
</table>
</body>
</html>
<? 
if($_POST['prossegue']) {
$nova = $_POST['nova'];
$VerificaStatus = mssql_fetch_row(mssql_query("select connectstat from memb_stat where memb___id='".$login."'"));

if ((eregi("[^a-zA-Z0-9_]", $nova)) ) {
echo "<script>alert('Não use Caracteres Incorretos.');
location='javascript:history.back()'</script>";
}
elseif($VerificaStatus[0] >= 1){
echo "<script>alert('Saia da conta'); 
location='javascript:history.back()'</script>";
}
else{
if(empty($nova)) {
echo "<script>alert('Digite uma senha'); 
	location='javascript:history.back()'</script>";	
}
else {
mssql_query("update memb_info set memb__pwd='".$nova."' where memb___id='".$login."'");
echo "<script>alert('Senha alterada para $nova'); 
	location='javascript:history.back()'</script>";	
} } }
} ?>