bonsoir merci pour votre intérêt ca me fait bcq de plaisir losque j'ai trouvé qlq qui va m'aider dans mon début :(
en faite mon problème consiste a ajouter ces info(les infos que vous avez corriger dès le début de la conversation: nom, prénom,age , sex,)a une autre base qui contient le login et le mot de passe de utilisateur:
voici le code :
inscrit .html
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>inscrit</title>
</head>
<body>
<form name="F2" action="insc.php" method="post">
<table width="385" align="center">
<tr>
<td>login</td>
<td><input type="text" name="log" /></td>
</tr>
<tr>
<td>Mot de passe</td>
<td><input type="password" name="pass1" /></td>
</tr>
<tr>
<td>Confirmer votre Mot de passe</td>
<td><input type="password" name="pass2" /></td>
</tr>
<td align="center" colspan="2"><input type="submit" value="connecter" name="ok" /></td>
</tr>
</table>
</form>
</body>
</html>
*** insc.php
<?php
// récupération des variables
$log = $_POST['log'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
require("connexion.php");
if (!empty($log) && !empty($pass1) && !empty($pass2))
{
if ( $pass1 != $pass2)
{ echo'<script language="javascript">
alert("check up your password")</script>';
/*echo"<script language=\"javascript\">";
echo"alert('your password please')";
echo"</script>"; */
header('location: inscrit.html'); // redirection
exit;
}
else
{
$sql = "INSERT INTO utilisateur(id, login, motpass) VALUES('','$log','$pass1')";
$req = mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
//echo' c bien ';
/* echo'<script language="javascript">
alert("good :p")</script>';*/
header('location: acceuil.html');
exit;
}
}
else
{//echo ' Remplire les champs ';
echo'<script language="javascript">
alert("check up your information please")</script>';
header('location: inscrit.html'); // redirection
exit;
}
?>
connexion.php
<?php
$con=mysql_connect("localhost","root","");
if ($con==false)
die ("impossible de connecter au serveur");
$b=mysql_select_db("bdpfe");
if ($b==false)
die ("aucune base est selectionner");
?>
et index.html // les membre déja créer un compte !!
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>index</title>
</head>
<body>
<form name="F1" action="connecter.php" method="post">
<table width="347" height="274" align="center">
<tr>
<td width="99" height="43">Login</td>
<td width="237"><h1>
<input type="text" name="log" />
</h1></td>
</tr>
<tr>
<td height="43">Pass Word</td>
<td> <input type="password" name="pass" /></td>
</tr>
<tr>
<td height="42" colspan="2" align="center"><a href="inscrit.html"> Create an account </a></td>
<tr>
<td height="134" colspan="2" align="center">
<input type="submit" value="Log In" name="ok" />
</a> </td>
</tr>
</table>
</form>
</body>
</html>
comment créer la deuxième base de donné , car chaque info ajouté(nom, prénom, ...) doit étre en relation avec le login ???????
