<? 
include ('logue.php'); 
include 'entete3.php';

if($idlogin !== "1") {
echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("apercu.php");
-->
</script>';
exit;
}
	
$sql = "SELECT vacance, login, mail, password, permmail FROM matgraph_users WHERE id='$idlogin'";
$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
$row = mysql_fetch_array($res); 

$login_actuel = $row[login];
$login = $_POST["New_speudo"];
$login = strtolower($login);

$testlogin = db_mysql_Query("SELECT * FROM matgraph_users WHERE login ='$login'");


if ($login !== $login_actuel) {
if ( mysql_num_rows( $testlogin ) != 0 ) {

echo '<script language=javascript> alert ("Vous etes bien sur le compte de '.$login.' .");</script>';

echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("apercu.php");
-->
</script>';

	exit;

}
}
?>


