Inscription formulaire et base de donnée
Je vous explique mon problème :
Je dois créer un site marchand . Pour cela, j'aimerais mettre en place une base de donnée via MySQL.
L'idée est que le client s'inscrit sur le site et que les données soient transférer vers ma table ( ici c'est client)
J'aimerais aussi que le client puisse se loguer par la suite sur le site.
Voici la page d'accueil du site qui s'appelle pagedaccueil.html
Code:
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
<title>Restaurant - Page d'accueil</title>
<body background = "anneaux_feu.jpg">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="mm_restaurant1.css" type="text/css" />
<style type="text/css">
<!--
.Style1 {color: #0066FF}
.Style3 {
font-family: cursive;
color: #999999;
}
.Style4 {
color: #330099;
font-size: 14px;
}
.Style8 {color: #999999}
.Style9 {
color: #0033FF;
font-size: 24px;
}
.Style11 {
color: #330099;
font-size: 18px;
}
.Style13 {
color: #330099;
font-size: 18;
}
.Style15 {
color: #330099;
font-size: 24px;
}
.Style16 {
color: #000000;
font-size: 24px;
}
.Style24 {
color: #FFFFFF;
font-size: 24px;
}
.Style29 {
color: #FF0000;
font-size: 24px;
}
.Style17 {color: #330099}
.Style19 {font-size: 14px}
-->
</style>
</head>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<background = "anneaux_feu.jpg">
<td width="226" nowrap="nowrap" background = "anneaux_feu.jpg" ><img alt="" width="15" height="1" border="0" /></td>
<td height="60" colspan="3" nowrap="nowrap" background = "anneaux_feu.jpg" class="logo"><br />
<span class="Style29">PIZZA HOT</span> <span class="tagline Style29"><span class="tagline Style11"><span class="tagline Style13"><span class="tagline Style15"><span class="tagline Style17">| <span class="Style3">Parceque c'est toujours chaud</span> </span></span></span></span></span></td>
<td width="4"> </td>
<td width="302"background = "anneaux_feu.jpg"> </td>
</tr>
<tr background = "anneaux_feu.jpg">
<td width="226" nowrap="nowrap" background = "anneaux_feu.jpg"> </td>
<td height="36" colspan="3" nowrap="nowrap" class="navText" id="navigation"><div align="center"><span class="Style24"><a href="Paged'acceuil.html">Acceuil </a> <a href="formule.html">Formule</a> <a href="carte.html">Carte</a> <a href="commande.html">Commande</a> </span> </div></td>
<td width="4"> </td>
<td width="302" background = "anneaux_feu.jpg"> </td>
</tr>
<tr background = "anneaux_feu.jpg">
<td colspan="2" valign="top" background = "anneaux_feu.jpg"><img src="pizzahot.jpg" alt="Home Page Image" width="227" height="170" border="0" />
<table border="0" cellspacing="0" cellpadding="0" width="0">
<tr>
<td width="10" background = "anneaux_feu.jpg"> </td>
<td width="205" background = "anneaux_feu.jpg" class="smallText" id="padding"><p> </p>
<p> </p>
<p align="center"><span class="subHeader Style8">Ouvert 7 jours sur 7<br />
De 10h00 à 14h30<br />
et de 19h00 à 22h30</span></p>
<p align="left"> </p>
<p align="center" class="Style8">Tel : 01 63 10 76 09 </p>
<p><br />
</p>
<br /> </td>
<td width="15" bordercolor="#0000FF" bgcolor="#0033FF"> </td>
</tr>
</table> </td>
<td width="50" valign="top"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
<td width="440" valign="top"><br />
<br />
<table width="483" height="461" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#ff0000" class="pageHeader Style16"><p align="center"> "Bienvenue chez Pizza hot </p>
<p align="center"> votre restaurant en ligne" </p></td>
</tr>
<tr>
<td background = "anneaux_feu.jpg" class="bodyText"><p align="center" class="Style8"> Toutes nos pizzas sont chaudes et préparés à la commande,<br />
vos plats seront accompagnés de ketchup,mayonnaise ou sauce piquante</p>
<p align="center" class="Style8">Chèques et tickets restaurants acceptés</p>
<p> </p>
<br /> </td>
</tr>
<tr>
<td bgcolor="#0033FF" class="bodyText"><div align="center" class="Style8">8 rue de l'obesité Paris 18 ème </div></td>
</tr>
</table> </td>
<td width="4"> </td>
<td width="302"><div align="left"></div></td>
</tr>
<form action="login.php" method='post'>
<td><span class="Style20">Login :</span></td>
<td><input type="text" name="login" maxlength="250"></td>
</tr>
<tr>
<td><span class="Style20">Password</span></td>
<td><input type="password"name="pass" maxlength="10"></td>
</tr>
<tr>
<td colspan="2" align="center"><input name="submit" type="submit" value="log in"></td>
</form>
</tr>
</table>
<p align="center"><a href="inscription.php" class="Style20">Vous voulez commander ? inscrivez-vous en cliquant ici ;) </a></p>
</tr>
<p align="center"><a href="referencement.php" class="Style20">Pas encore référencer ? cliquer ici pour recevoir la newsletter </a></p>
</div></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td colspan="6"> </td>
</tr>
<tr bgcolor="#003399">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
</tr>
<tr bgcolor="#003399">
<td colspan="6"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td width="226"> </td>
<td width="4"> </td>
<td width="50"> </td>
<td width="440"> </td>
<td width="4"> </td>
<td width="302"> </td>
</tr>
</table>
</body>
</html> |
Inscription.php :
Code:
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
|
<html>
<img src="pizzahot.jpg" alt="Home Page Image" width="227" height="170" border="0" />
<table border="0" cellspacing="0" cellpadding="0" width="230">
<basefont face ="verdana" size = "4" color = "navy">
<B>Veuillez remplir les champs pour pouvoir vous inscrire</B>
<form action="traitementinscription.php" method='post'>
<table align="center" border="0">
<tr>
<td>Login :</td>
<td><input type="text" name="login" maxlength="250"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pass" maxlength="10"></td>
</tr>
<tr>
<td>Telephone</td>
<td><input type="number" name="telephone" maxlength="10"></td>
</tr>
<tr>
<td>Nom</td>
<td><input type="text" name="nom" maxlength="25"></td>
</tr>
<tr>
<td>Prenom</td>
<td><input type="text" name="prenom" maxlength="25"></td>
</tr>
<tr>
<td>Adresse</td>
<td><input type="text" name="adresse" maxlength="50"></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" maxlength="50"></td>
</tr>
<td colspan="2" align="center"><input type="submit" value="S'inscrire"></td>
</tr>
</table>
</form>
</html> |
traitementinscription.php :
Code:
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
|
<hmtl>
<img src="pizzahot.jpg" alt="Home Page Image" width="227" height="170" border="0" />
<table border="0" cellspacing="0" cellpadding="0" width="230">
<?php
$dbhost = "localhost";
$usebdd = "inscription";
$user= "root";
$password= "";
$connexion = mysql_connect ("$dbhost","$user","$password");
mysql_select_db($usebdd);
if(isset($_POST) && !empty($_POST['login']) && !empty($_POST['pass'])) {
extract($_POST);
// $sql = "select mdp from client where login='".$login."'";
$sql = "insert into client (login,mdp,telephone,nom,prenom,adresse,email)
values ('".$login."' , '".$pass."' , '".$telephone."' , '".$nom."' , '".$prenom."' , '".$adresse."' , '".$email."')";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
echo " Votre compte a bien été créé <a href='pagedaccueil.html'> cliquez ici pour retourner à la page d'acceuil </a> ";
}
?>php
</html> |
Je suis débutant et je ne comprend pas ou est le probleme. J'ai bien entendu creer une bdd inscription et une table client
Help me :)