Bonjour,
Aujourd'hui, j'ai commencé mon site, j'ai fais un systeme de login, en fonction d'une inscription qui se fait autrement (par /register sur un serveur minecraft), le login fonctionne sur MON
google chrome , ne fonctionne pas sur
FF et
IE7 . Je demande alors si quelqu'un a une solution, mon code : (mal codé, je suis débutant la dedans)
<?php
error_reporting(0);
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
body {
background-image: url(Images/background.jpg);
background-repeat: no-repeat;
}
#header {
background-image:url(Images/Header.png);
background-repeat:no-repeat;
width:824px;
height:195px;
position:relative;
margin:auto;
text-align:left;
}
#content {
background-image: url(Images/Content.png);
width: 824px;
height: auto;
background-repeat: repeat-y;
position: relative;
margin: auto;
font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
text-align: left;
padding-bottom: 0px;
padding-top: 0px;
}
#footer {
background-image:url(Images/Footer.png);
width:824px;
height:60px;
background-repeat:no-repeat;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
position:relative;
margin:auto;
text-align:left;
}
#skyfight {
padding-top:11px;
padding-left:40px;
float:none;
}
#m {
color:#DDD;
text-decoration:none;
}
#m:hover {
color:white;
text-decoration:none;
}
#menu {
padding-right: 25px;
text-align: right;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
padding-top: 63px;
font-weight: bold;
font-size: 18px;
}
#gris {
color:#666;
}
#gris:hover {
color:#666;
cursor:default;
}
#cr {
color:#FFF;
padding-top:0px;
padding-left:30px;
cursor:default;
display:inline-block;
text-align:left;
padding-top:17px;
width:465px;
}
#connexion {
text-align: right;
display: block;
padding-right: 25px;
padding-top:5px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
cursor:default;
}
#co:hover {
color:white;
text-decoration:none;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
#co {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
color:#DDD;
text-decoration:none;
}
#co2 {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
color:#BBB;
text-decoration:none;
}
#gris-fonce {
color:#444
}
#rs {
display:inline-block;
text-align:right;
padding-right:20px;
width:300px;
padding-top:6px;
vertical-align: top;
}
#text {
padding-top:10px;
padding-left:0px;
text-align:center;
}
green {
color:green;
}
#h1 {
padding-top: 20px;
padding-bottom:20px;
text-align: center;
font-size: 42px;
color:#aaa;
}
#contenue{
text-align:center;
font-size:18px;
padding-bottom:30px;
}
rouge {
color:#C00;
font-size:12px;
}
bleu {
color:#00C;
font-size:12px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">
<title>Spyfight | Un serveur unique</title>
<link href="Slider/js-image-slider.css" rel="stylesheet" type="text/css" />
<script src="Slider/js-image-slider.js" type="text/javascript"></script>
</head>
<body>
<!-- HEADER -->
<!-- IMAGE SKYFIGHT -->
<div id="header" align="center">
<div id="connexion">
<?php
if(isset($_SESSION['username'])){
$ifsession = '<span id="co2">Bonjour, '.$_SESSION['username'].' ! <img src="https://minotar.net/avatar/'.$_SESSION['username'].'/16.png"/></img>'.'</span><span id="gris-fonce"> | </span><a href="deconnexion.php" id="co">Deconnexion</a>';
}else{
?>
<a href="" id="co">Connexion</a><span id="gris-fonce"> | </span><a href="" id="co">Comment s'inscrire ?</a>
<?php
}
if (isset($ifsession)) echo '',$ifsession;
?>
</div>
<a href="index.php"><img src="Images/Skyfight-grand.png" id="skyfight" alt="Skyfight"/></img></a>
<!-- MENU -->
<div id="menu">
<a href="/alpha/index.php" id="m">Accueil</a><span id="gris"> | </span>
<a href="/alpha/serveur.php" id="m">Le serveur</a><span id="gris"> | </span>
<a href="/alpha/news.php" id="m">Nouveautés</a><span id="gris"> | </span>
<a href="/alpha/boutique" id="m">Boutique</a><span id="gris"> | </span>
<a href="/alpha/contact.php" id="m">Contact</a>
</div>
</div>
<!-- CONTENT -->
<div id="content" align="center">
<div id="h1">-CONNEXION-</div><br/>
<div id="contenue">
<?php
if(isset($_POST['submit'])){
if(!empty($_POST['username']) && !empty($_POST['password'])){
$username = htmlspecialchars(trim($_POST['username']));
$password = htmlspecialchars(trim($_POST['password']));
$password = md5($password);
$connect = mysql_connect('xxx.xxxxxx.xx', 'yyyy', 'zzzzzzzz');
mysql_select_db('yyyy');
$log = mysql_query("SELECT * FROM membres WHERE username='$username' AND password='$password'");
$rows = mysql_num_rows($log);
if($rows==1){
$_SESSION['username']=$username;
echo "<meta http-equiv='refresh' content='0';URL=supprimer.php?refresh=1'>";
}else{
$erreur = '<br/>Pseudo ou mot de passe incorrecte.';
}
}else{
$erreur = '<br/>Veuillez remplir tous les champs.';
}
}
?>
<?php
if(isset($_SESSION['username'])){
$erreur = '<bleu>Vous êtes connecté en tant que '.$_SESSION['username'].'.</bleu>';
}else{
?>
<form action="connexion.php" method="post">
Pseudo :<input type="text" name="username" placeholder="ex : toto9158"/><br /><br/>
Mot de passe :<input type="password" name="password" placeholder=""/><br /><br/>
<input type="submit" name="submit" value="Connexion">
</form>
<?php
}
?>
<rouge>
<?php
if (isset($erreur)) echo '',$erreur;
?>
</rouge>
</div>
<!-- FOOTER -->
<div id="footer" align="center">
<div id="cr">© Copyright 2013 | Spyfight - Tous droits réservés.</div>
<div id="rs" align="right">
<a href=""><img src="icone_sociaux/youtube.png" alt="Youtube" width="52" height="52" /></a>
<a href=""><img src="icone_sociaux/facebook.png" alt="Facebook" width="52" height="52" /></a>
<a href=""><img src="icone_sociaux/twitter.png" alt="Twitter" width="52" height="52" /></a>
<a href=""><img src="icone_sociaux/rss.png" alt="RSS" width="52" height="52" /></a>
<a href=""><img src="icone_sociaux/google.png" alt="Google" width="52" height="52" /></a></div>
</div>
</body>
</html>
Je me demande alors si cela n'as pas de rapport avec les session, ce qui ce passe chez mes amis, c'est que ils entre leurs identifiants correctes, et quand ils cliquent sur connexion, il voies "connecter en tant que xxxx." pendant 2 secondes, puis ils sont déconnecter et sont renvoyer a la page de connexion initiale.
Cordialement, Julos68.
Afficher la suite