Bonjour a tous voilà j ai recement fait appel a un codeur pour m aider ds la création de mon site :
http://www.partage-playlist.com/
Et apres essai je me suis rendu compte que la partie "inscription" ne marchais pas..
Vu que c'est lui qui a codé cette partie, je demande votre aide juste pour me dire si vous voyez ou pas quelque chose qui vous choque sur le fichier "inscription" :
<?php
session_start();
// on teste si le visiteur a soumis le formulaire
if (isset($_POST['inscription']) && $_POST['inscription'] == 'Inscription') {
// on teste l'existence de nos variables. On teste également si elles ne sont pas vides
if (!empty($_POST['login']) && !empty($_POST['pass']) && !empty($_POST['pass_confirm']) && isset($_POST['age']) && isset($_POST['sexe']) && !empty($_POST['ville']) && !empty($_POST['pays']) && !empty($_POST['style']) && !empty($_POST['description'])) {
// on teste les deux mots de passe
if ($_POST['pass'] != $_POST['pass_confirm']) {
$erreur = 'Les 2 mots de passe sont différents.';
}
else {
require_once('Connections/mabase.php');
// on recherche si ce login est déjà utilisé par un autre membre
$sql = 'SELECT id
FROM utilisateurs
WHERE identifiant = \''.mysql_real_escape_string($_POST['login']).'\'
LIMIT 1';
$res = mysql_query($sql);
if (!mysql_num_rows($res)) {
$sql = 'INSERT INTO utilisateurs (
identifiant,
mot_de_passe,
age,
sexe,
ville,
pays,
style,
description
)
VALUES(
\''.mysql_real_escape_string($_POST['login']).'\',
\''.mysql_real_escape_string(md5($_POST['pass'])).'\',
'.intval($_POST['age']).',
'.min(1, intval($_POST['sexe'])).',
\''.mysql_real_escape_string($_POST['ville']).'\',
\''.mysql_real_escape_string($_POST['pays']).'\',
\''.mysql_real_escape_string($_POST['style']).'\',
\''.mysql_real_escape_string($_POST['description']).'\'
)';
mysql_query($sql);
$_SESSION['id'] = mysql_insert_id();
mail('[email protected]', 'Inscription', 'Un nouvel utilisateur s\'est inscrit : '.$_POST['login'], 'From: [email protected]');
header('Location: membre.php');
exit();
}
else {
$erreur = 'Un membre possède déjà ce login.';
}
}
}
else {
$erreur = 'Au moins un des champs est vide.';
}
}
?>
<html>
<head>
<title>Inscription</title>
<meta name="description" content="Music website">
<meta name="keywords" content="music, mp3">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="183" colspan="2" valign="top" background="images/bg_03.gif" class="bgx"><table width="100%" height="183" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="153" colspan="2" valign="top"><table width="100%" height="153" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="169" background="images/bg_h01.jpg" class="bgnr"><div class="dv"><img src="images/el_01.gif" alt="" width="146" height="183"></div></td>
<td width="318" valign="top" background="images/bg_h02.jpg" class="bgnr"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="61"><img src="images/logo.gif" alt="" width="61" height="50"></td>
<td width="268"><h1>Partage-Playlist</h1></td>
</tr>
</table></td>
<td align="right" valign="bottom" background="images/bg_h03.jpg" class="bgnr"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="199" height="30" bgcolor="#C47F39"> </td>
<td bgcolor="#1D1511"><table height="30" border="0" cellpadding="0" cellspacing="0" class="menu">
<tr>
<td align="center"><a href="index.php">Acceuil</a><a href="#"></a></td>
<td align="center"><a href="playlist.php">Playlist</a><a href="#"></a></td>
<td align="center"><a href="playlist.php?top">Classement</a><a href="#"></a></td>
<td align="center"><? if (empty($_SESSION['id'])) { ?><a href="inscription.php">s'enregistrer</a><? } else { ?><a href="membre.php">espace membre</a><? } ?><a href="#"></a></td>
<td align="center"><? if (empty($_SESSION['id'])) { ?><a href="enreistrement.php">Connexion</a><? } else { ?><a href="deconnexion.php">Déconnexion</a><? } ?><a href="#"></a></td>
<td align="center"><a href="liens.php">Liens</a><a href="#"></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="100%" colspan="2" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="199" valign="top" background="images/bg_02.gif" bgcolor="#1D1511" class="bgx"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="index.php">Acceuil</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="playlist.php">Playlist</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="playlist.php?top">Classement</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><? if (empty($_SESSION['id'])) { ?><a href="inscription.php">s'enregistrer</a><? } else { ?><a href="membre.php">espace membre</a><? } ?><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><? if (empty($_SESSION['id'])) { ?><a href="enreistrement.php">Connexion</a><? } else { ?><a href="deconnexion.php">Déconnexion</a><? } ?><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="liens.php">Liens</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><? require_once('nb_connectes.php') ?></td>
</tr>
</table></td>
<td height="100%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="48" background="images/bg_04.gif"><table width="100%" height="48" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="23"><img src="images/bg_05.gif" alt="" width="23" height="48"></td>
<td background="images/bg_06.gif" class="bgrr title"><h1>Inscription</h1></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" bgcolor="#1D1511" class="content"><p>
<script type="text/javascript"><!--
google_ad_client = "pub-3060654316043618";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2006-11-21: Web templates - LAYOUTS
google_ad_channel = "0286771451";
google_color_border = "1D1511";
google_color_bg = "1D1511";
google_color_link = "E14137";
google_color_text = "000000";
google_color_url = "B3B3B3";
//--></script>
Veuillez remplir le formulaire ci-dessous afin de vous inscrire
</p><form action="inscription.php" method="post">
<table width="505" height="391" border="0">
<tr>
<td width="172">Login :</td>
<td width="317"><input type="text" name="login" value="<?php if (isset($_POST['login'])) echo htmlentities(trim($_POST['login'])); ?>"></td>
</tr>
<tr>
<td>Mot de passe : </td>
<td><input type="password" name="pass" value="<?php if (isset($_POST['pass'])) echo htmlentities(trim($_POST['pass'])); ?>"></td>
</tr>
<tr>
<td><br />
Confirmation du mot de passe : </td>
<td><input type="password" name="pass_confirm" value="<?php if (isset($_POST['pass_confirm'])) echo htmlentities(trim($_POST['pass_confirm'])); ?>"></td>
</tr>
<tr>
<td>Age :</td>
<td><input type="text" name="age" maxlength="3" value="<?php if (isset($_POST['age'])) echo intval($_POST['pass_confirm']); ?>">
ans</td>
</tr>
<tr>
<td>Sexe :</td>
<td><input type="radio" name="sexe" value="0"<?=empty($_POST['sexe']) ? ' checked="checked"' : '' ?>>
Homme
<input type="radio" name="sexe" value="1"<?=!empty($_POST['sexe']) ? ' checked="checked"' : '' ?>>
Femme</td>
</tr>
<tr>
<td>Ville :</td>
<td><input type="text" name="ville" value="<?php if (isset($_POST['ville'])) echo htmlentities(trim($_POST['ville'])); ?>"></td>
</tr>
<tr>
<td>Pays :</td>
<td><input type="text" name="pays" value="<?php if (isset($_POST['pays'])) echo htmlentities(trim($_POST['pays'])); ?>"></td>
</tr>
<tr>
<td>Style musical : </td>
<td><input type="text" name="style" value="<?php if (isset($_POST['style'])) echo htmlentities(trim($_POST['style'])); ?>"></td>
</tr>
<tr>
<td height="135">Présentation :</td>
<td><textarea name="description2" cols="50" rows="8"><?php if (isset($_POST['description'])) echo htmlentities(trim($_POST['description'])); ?>
</textarea></td>
</tr>
</table><br />
<input type="submit" name="inscription" value="Inscription">
</form>
<?php
if (isset($erreur)) echo '<br />',$erreur;
?>
<div style="text-align:center">
</p></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="210" height="23" background="images/bg_01.gif" bgcolor="#E02D17"> </td>
<td background="images/bg_01.gif" bgcolor="#E02D17" class="bmenu">Partage-Playlist || <a href="#">33150</a> ||<a href="mailto:[email protected]"> [email protected]</a> || 2010 ||<br />
<br />
Copyright dj sky© 2010. Provided By <a href="http://www.template4all.com">Free CSS Templates</a></td>
</tr>
</table>
<div style="position:absolute;left:-30000px;top:-30000px"><a href="http://anvisionwebtemplates.com">Website templates</a><a href="http://www.template4all.com">Free Web Templates</a><a href="http://www.freethemes4all.com">Freethemes4all.com</a><a href="http://anvisionwebdesign.com">Website design company</a><a href="http://webdesignfinders.net">Web design directory</a><a href="http://australia.webdesignfinders.net">Web design directory Australia</a><a href="http://canada.webdesignfinders.net">Web design directory Canada</a><a href="http://anvisionwebtemplates.com/free-music-web-templates-layouts.html">Free music web templates</a></div>
</body>
</html>
merci d'avance !:P
Bonjour a tous voilà j ai recement fait appel a un codeur pour m aider ds la création de mon site :
[url]http://www.partage-playlist.com/[/url]
Et apres essai je me suis rendu compte que la partie "inscription" ne marchais pas..
Vu que c'est lui qui a codé cette partie, je demande votre aide juste pour me dire si vous voyez ou pas quelque chose qui vous choque sur le fichier "inscription" :
[html]<?php
session_start();
// on teste si le visiteur a soumis le formulaire
if (isset($_POST['inscription']) && $_POST['inscription'] == 'Inscription') {
// on teste l'existence de nos variables. On teste également si elles ne sont pas vides
if (!empty($_POST['login']) && !empty($_POST['pass']) && !empty($_POST['pass_confirm']) && isset($_POST['age']) && isset($_POST['sexe']) && !empty($_POST['ville']) && !empty($_POST['pays']) && !empty($_POST['style']) && !empty($_POST['description'])) {
// on teste les deux mots de passe
if ($_POST['pass'] != $_POST['pass_confirm']) {
$erreur = 'Les 2 mots de passe sont différents.';
}
else {
require_once('Connections/mabase.php');
// on recherche si ce login est déjà utilisé par un autre membre
$sql = 'SELECT id
FROM utilisateurs
WHERE identifiant = \''.mysql_real_escape_string($_POST['login']).'\'
LIMIT 1';
$res = mysql_query($sql);
if (!mysql_num_rows($res)) {
$sql = 'INSERT INTO utilisateurs (
identifiant,
mot_de_passe,
age,
sexe,
ville,
pays,
style,
description
)
VALUES(
\''.mysql_real_escape_string($_POST['login']).'\',
\''.mysql_real_escape_string(md5($_POST['pass'])).'\',
'.intval($_POST['age']).',
'.min(1, intval($_POST['sexe'])).',
\''.mysql_real_escape_string($_POST['ville']).'\',
\''.mysql_real_escape_string($_POST['pays']).'\',
\''.mysql_real_escape_string($_POST['style']).'\',
\''.mysql_real_escape_string($_POST['description']).'\'
)';
mysql_query($sql);
$_SESSION['id'] = mysql_insert_id();
mail('
[email protected]', 'Inscription', 'Un nouvel utilisateur s\'est inscrit : '.$_POST['login'], 'From:
[email protected]');
header('Location: membre.php');
exit();
}
else {
$erreur = 'Un membre possède déjà ce login.';
}
}
}
else {
$erreur = 'Au moins un des champs est vide.';
}
}
?>
<html>
<head>
<title>Inscription</title>
<meta name="description" content="Music website">
<meta name="keywords" content="music, mp3">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="183" colspan="2" valign="top" background="images/bg_03.gif" class="bgx"><table width="100%" height="183" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="153" colspan="2" valign="top"><table width="100%" height="153" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="169" background="images/bg_h01.jpg" class="bgnr"><div class="dv"><img src="images/el_01.gif" alt="" width="146" height="183"></div></td>
<td width="318" valign="top" background="images/bg_h02.jpg" class="bgnr"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="61"><img src="images/logo.gif" alt="" width="61" height="50"></td>
<td width="268"><h1>Partage-Playlist</h1></td>
</tr>
</table></td>
<td align="right" valign="bottom" background="images/bg_h03.jpg" class="bgnr"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="199" height="30" bgcolor="#C47F39"> </td>
<td bgcolor="#1D1511"><table height="30" border="0" cellpadding="0" cellspacing="0" class="menu">
<tr>
<td align="center"><a href="index.php">Acceuil</a><a href="#"></a></td>
<td align="center"><a href="playlist.php">Playlist</a><a href="#"></a></td>
<td align="center"><a href="playlist.php?top">Classement</a><a href="#"></a></td>
<td align="center"><? if (empty($_SESSION['id'])) { ?><a href="inscription.php">s'enregistrer</a><? } else { ?><a href="membre.php">espace membre</a><? } ?><a href="#"></a></td>
<td align="center"><? if (empty($_SESSION['id'])) { ?><a href="enreistrement.php">Connexion</a><? } else { ?><a href="deconnexion.php">Déconnexion</a><? } ?><a href="#"></a></td>
<td align="center"><a href="liens.php">Liens</a><a href="#"></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="100%" colspan="2" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="199" valign="top" background="images/bg_02.gif" bgcolor="#1D1511" class="bgx"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="index.php">Acceuil</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="playlist.php">Playlist</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="playlist.php?top">Classement</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><? if (empty($_SESSION['id'])) { ?><a href="inscription.php">s'enregistrer</a><? } else { ?><a href="membre.php">espace membre</a><? } ?><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><? if (empty($_SESSION['id'])) { ?><a href="enreistrement.php">Connexion</a><? } else { ?><a href="deconnexion.php">Déconnexion</a><? } ?><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><strong><a href="liens.php">Liens</a><a href="#"></a></strong></td>
</tr>
<tr>
<td height="20" align="right" background="images/nitem.gif" class="nitem bgnr"><? require_once('nb_connectes.php') ?></td>
</tr>
</table></td>
<td height="100%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="48" background="images/bg_04.gif"><table width="100%" height="48" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="23"><img src="images/bg_05.gif" alt="" width="23" height="48"></td>
<td background="images/bg_06.gif" class="bgrr title"><h1>Inscription</h1></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" bgcolor="#1D1511" class="content"><p>
<script type="text/javascript"><!--
google_ad_client = "pub-3060654316043618";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2006-11-21: Web templates - LAYOUTS
google_ad_channel = "0286771451";
google_color_border = "1D1511";
google_color_bg = "1D1511";
google_color_link = "E14137";
google_color_text = "000000";
google_color_url = "B3B3B3";
//--></script>
Veuillez remplir le formulaire ci-dessous afin de vous inscrire
</p><form action="inscription.php" method="post">
<table width="505" height="391" border="0">
<tr>
<td width="172">Login :</td>
<td width="317"><input type="text" name="login" value="<?php if (isset($_POST['login'])) echo htmlentities(trim($_POST['login'])); ?>"></td>
</tr>
<tr>
<td>Mot de passe : </td>
<td><input type="password" name="pass" value="<?php if (isset($_POST['pass'])) echo htmlentities(trim($_POST['pass'])); ?>"></td>
</tr>
<tr>
<td><br />
Confirmation du mot de passe : </td>
<td><input type="password" name="pass_confirm" value="<?php if (isset($_POST['pass_confirm'])) echo htmlentities(trim($_POST['pass_confirm'])); ?>"></td>
</tr>
<tr>
<td>Age :</td>
<td><input type="text" name="age" maxlength="3" value="<?php if (isset($_POST['age'])) echo intval($_POST['pass_confirm']); ?>">
ans</td>
</tr>
<tr>
<td>Sexe :</td>
<td><input type="radio" name="sexe" value="0"<?=empty($_POST['sexe']) ? ' checked="checked"' : '' ?>>
Homme
<input type="radio" name="sexe" value="1"<?=!empty($_POST['sexe']) ? ' checked="checked"' : '' ?>>
Femme</td>
</tr>
<tr>
<td>Ville :</td>
<td><input type="text" name="ville" value="<?php if (isset($_POST['ville'])) echo htmlentities(trim($_POST['ville'])); ?>"></td>
</tr>
<tr>
<td>Pays :</td>
<td><input type="text" name="pays" value="<?php if (isset($_POST['pays'])) echo htmlentities(trim($_POST['pays'])); ?>"></td>
</tr>
<tr>
<td>Style musical : </td>
<td><input type="text" name="style" value="<?php if (isset($_POST['style'])) echo htmlentities(trim($_POST['style'])); ?>"></td>
</tr>
<tr>
<td height="135">Présentation :</td>
<td><textarea name="description2" cols="50" rows="8"><?php if (isset($_POST['description'])) echo htmlentities(trim($_POST['description'])); ?>
</textarea></td>
</tr>
</table><br />
<input type="submit" name="inscription" value="Inscription">
</form>
<?php
if (isset($erreur)) echo '<br />',$erreur;
?>
<div style="text-align:center">
</p></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="210" height="23" background="images/bg_01.gif" bgcolor="#E02D17"> </td>
<td background="images/bg_01.gif" bgcolor="#E02D17" class="bmenu">Partage-Playlist || <a href="#">33150</a> ||<a href="mailto:
[email protected]">
[email protected]</a> || 2010 ||<br />
<br />
Copyright dj sky© 2010. Provided By <a href="http://www.template4all.com">Free CSS Templates</a></td>
</tr>
</table>
<div style="position:absolute;left:-30000px;top:-30000px"><a href="http://anvisionwebtemplates.com">Website templates</a><a href="http://www.template4all.com">Free Web Templates</a><a href="http://www.freethemes4all.com">Freethemes4all.com</a><a href="http://anvisionwebdesign.com">Website design company</a><a href="http://webdesignfinders.net">Web design directory</a><a href="http://australia.webdesignfinders.net">Web design directory Australia</a><a href="http://canada.webdesignfinders.net">Web design directory Canada</a><a href="http://anvisionwebtemplates.com/free-music-web-templates-layouts.html">Free music web templates</a></div>
</body>
</html>[/html]
merci d'avance !:P