Bienvenue! Identification Créer un nouveau profil

Recherche avancée

formulaire

gendrak
15/11/04 15:07
satut a tous, ben voila c'est la premiere fois que je suis sur ce site et j'espere que ca pourra m'aidé. voila je vient de faire un formulaire dans dream et aussi ma basse de donné dans php mais le probleme comment les maitre ensemble et j'ai aussi un probleme quand je créer un je d'enregistrement.
voici ce que j'ai fait:

<?
//connection a la base de donner
$db_host="127.0.0.1";
$db_login="root";
$db_password="";

$db=mysql_connect($db_host,$db_login,$db_password);

mysql_select_db("test"winking smiley or die("Could not select database"winking smiley or die("pas de base"winking smiley;

?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ACSE</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
font-weight: bold;
}
body {
background-color: #333333;
}
-->
</style></head>

<body>
<div id="Layer1" style="position: absolute; left: 125px; top: -1px; width: 622px; height: 530px; z-index: 1">
<form action="<? $_SERVER['PHP_SELF'];?>"method="post" name="formulaire" id="formulaire" >
<table width="628" border="0">
<tr>
<td width="112">Nom disappointed smiley/td>
<td width="500"><input name="nom" type="text" id="nom" size="50" maxlength="50"></td>
</tr>
</table>
<table width="628" border="0">
<tr>
<td width="112">Pr&eacute;nom disappointed smiley/td>
<td width="500"><input name="prenom" type="text" id="prenom" size="50" maxlength="50"></td>
</tr>
</table>
<table width="628" border="0">
<tr>
<td width="112" height="56">Adressedisappointed smiley/td>
<td width="500"><textarea name="adresse" cols="50" rows="2" id="adresse"></textarea></td>
</tr>
</table>
<table width="627" border="0">
<tr>
<td width="112">Code Postal : </td>
<td width="110"><input name="CP" type="text" id="CP" size="5" maxlength="5"></td>
<td width="28">&nbsp;</td>
<td width="112">Ville disappointed smiley/td>
<td width="231"><select name="ville" id="ville">
<option>Reims</option>
</select></td>
</tr>
</table>
<table width="628" border="0">
<tr>
<td width="112">Soci&eacute;t&eacute; : </td>
<td width="500"><input name="société" type="text" id="société" size="50" maxlength="120"></td>
</tr>
</table>
<table width="628" border="0">
<tr>
<td width="112">Activit&eacute; : </td>
<td width="500"><input name="activité" type="text" id="activité" size="50" maxlength="50"></td>
</tr>
</table>
<table width="628" border="0">
<tr>
<td width="112">E-mail : </td>
<td width="500"><input name="mail" type="text" id="mail" size="50" maxlength="120"></td>
</tr>
</table>
<table width="628" border="0">
<tr>
<td width="112">Site internet : </td>
<td width="500"><input name="site" type="text" id="site" size="50" maxlength="120"></td>
</tr>
</table>
<table width="631" border="0">
<tr>
<td width="114">T&eacute;l : </td>
<td width="94"><input name="tel" type="text" id="tel" size="10" maxlength="10"></td>
<td width="114">fax : </td>
<td width="92"><input name="fax" type="text" id="fax" size="10" maxlength="10"></td>
<td width="114">Portable disappointed smiley/td>
<td width="77"><input name="portable" type="text" id="portable" size="10" maxlength="10"></td>
</tr>
</table>
<table width="631" border="0">
<tr>
<td width="112">Commentaire : </td>
<td width="509"><textarea name="commentaire" cols="50" rows="10" id="commentaire"></textarea></td>
</tr>
</table>
<table width="632" height="34" border="0">
<tr>
<td width="263" height="30"><div align="right">
<label>
<input name="envoyer" type="submit" id="envoyer" value="Envoyer">
</label>
</div></td>
<td width="29">&nbsp;</td>
<td width="318"><input name="annulee" type="reset" id="annulee" value="Annulée"></td>
</tr>
</table>
</form>
<?
if(isset($_POST['logue']))
{
//******execute la requete
$non = $_POST['logue'];
$pwd= $_POST['PWD'];
//va chercher le not de passe
$query = "SELECT Pwd From users WHERE Login = '".$non."'";

//ajout un utileur
INSERT INTO `socite` (`Num`, `Nom`, `tel`, `adresse`, `Cpostal`) VALUES ('1', 'gut', '0326864675', ' 4 hjfghjgb ', '5110');
$result = mysql_query($query) ;
while($row = mysql_fetch_array($result))
if($pwd==$row["Pwd"])
echo "ok";
else
echo "non ok";
}
?>


</div>

</body>
</html>
SujetAuteurEnvoyé le

formulaire

gendrak15/11/04 15:07

Re: formulaire

Hervé Inisan15/11/04 15:38

Re: formulaire

dsfsdfds20/12/04 00:02

Seuls les utilisateurs enregistrés peuvent poster des messages dans ce forum.

Cliquez ici pour vous connecter