Skip to content

Instantly share code, notes, and snippets.

@valeriu
Created December 13, 2012 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valeriu/4278968 to your computer and use it in GitHub Desktop.
Save valeriu/4278968 to your computer and use it in GitHub Desktop.
Exercice 07-3 b
<html>
<head>
<title>Exercice 07-3 b</title>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">
const CODE = "secret01";
const PASSE = "pizza";
var codeUtilisateur = window.prompt("Code utilisateur", "");
var motPasse = window.prompt("Mot de passe", "");
switch(codeUtilisateur)
{
case CODE:
switch(motPasse)
{
case PASSE :
window.alert("Vous avez acces au reseau");
break;
case "" :
window.alert("Vous devez specifier le code utilisateur et le mot de passe");
break;
default :
window.alert("Mot de passe incorect");
break;
}
break;
case "" :
window.alert("Vous devez specifier le code utilisateur et le mot de passe");
break;
default :
window.alert("Utilisateur inconnu");
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment