1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| <?php
session_start();
// on teste si le visiteur a remplis et soumis le formulaire de connexion
if(isset($_POST['submit']))
{
$username = htmlentities(trim($_POST['username']));
$password = htmlentities(trim($_POST['password']));
if($username&&$password)
{
$password = md5($password);
$connect = mysql_connect('','','');
mysql_select_db('');
$query = mysql_query("SELECT*FROM users WHERE username='$username'&&password='$password'");
$rows = mysql_num_rows($query);
if($rows==1)
{
$SESSION['username']=$username;
header('ICI JE SOUHAITE APPELER L URL');
}else echo"Pseudo ou password incorrect";
}else echo"Veuiller saisir tous les champs";
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Sunrise Stories Launcher</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/main.css">
<link rel="icon" type="image/png" href="img/favicon.png" />
<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" /><![endif]-->
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please
<a href="http://browsehappy.com/">upgrade your browser</a> or
<a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.
</p>
<![endif]-->
<center><div class="logo"></div></center>
<div class="container">
<p>Veuillez entrer le mot de passe pour acceder à votre interface</p>
<form action="login.php" method="post">
<p>
<input type="text" name="username" />
<input type="password" name="password" />
<input type="submit" value="Valider" name="submit" />
</p>
</form>
<hr />
<footer><p>©2014 <a href="#">Sunrise</a></p></footer>
<div id="gettask"></div>
</div>
<script src="js/main.min.js"></script>
</body>
</html> |
Partager