Php enregistrement mySql
Utilisateur anonyme
-
kij_82 Messages postés 4260 Statut Contributeur -
kij_82 Messages postés 4260 Statut Contributeur -
Bonsoir, j'essaye à tout pris de faire un enregistrement dans une BDD Mysql.
Voici le code PHP :
Le Formulaire (dans la même page) :
Voici le code PHP :
<?php
if (isset($_POST['pseudo']) and ($_POST['passe']) and ($_POST['prenom']) and ($_POST['nom']) and ($_POST['email']) and ($_POST['location']))
{
try
{
$bdd = new PDO('mysql:host=localhost;bdname=test', 'root', '');
}
catch(Exeption $e)
{
die('Erreur :' .$e->getmessage());
}
$req = $bdd->prepare('INSERT INTO membre(pseudo, passe, prenom, nom, email) VALUES (:$_POST[\'pseudo\'],$_POST[\'passe\'],$_POST[\'prenom\'],$_POST[\'nom\'],$_POST[\'email\']');
$req->execute(array('pseudo' => $_POST['pseudo'],'passe' => $_POST['passe'],'prenom' => $_POST['prenom'],'nom' => $_POST['nom'],'passe' => $_POST['email']));
echo"Merci, vous êtes maintenant inscrit(e) sur Reseau41 !";
}
?>
Le Formulaire (dans la même page) :
<form action="" method="POST"> <table width="100%" height="%" cellpadding="0" cellspacing="0" align="center" border="0"> <tr> <td><img src="icones/38.png" width="14" height="14"></td><td><b>Pseudo :</b></td><td align="right"><input type="text" name="pseudo" style="background-color:#eef5fc; width:315;"></td></tr> <tr> <td><img src="icones/56.png" width="14" height="14"></td><td><b>Mot de Passe :</b></td><td align="right"><input type="password" name="passe" style="background-color:#eef5fc; width:315;"></td></tr> <tr> <td><img src="icones/37.png" width="14" height="14"></td><td><b>Prenom :</b></td><td align="right"><input type="text" name="prenom" style="background-color:#eef5fc; width:315;"></td></tr> <tr> <td><img src="icones/37.png" width="14" height="14"></td><td><b>Nom :</b></td><td align="right"><input type="text" name="nom" style="background-color:#eef5fc; width:315;"></td></tr> <tr> <td><img src="icones/47.png" width="14" height="14"></td><td><b>E-mail :</b></td><td align="right"><input type="text" name="email" style="background-color:#eef5fc; width:315;"></td></tr> <tr> <td><img src="icones/61.png" width="14" height="14"></td><td><b>Location :</b></td><td align="right"><input type="text" name="location" style="background-color:#eef5fc; width:315;"></td></tr> <td></td><td></td><td align="right"><input type="submit" value="Envoyer" style="background-color:#eef5fc; width:150;"></td> </table>
A voir également:
- Php enregistrement mySql
- Easy php - Télécharger - Divers Web & Internet
- Enregistrement mp3 gratuit - Télécharger - Streaming audio
- Enregistrement - Guide
- Telecharger studio d'enregistrement rap - Télécharger - Édition & Montage
- Mysql community server - Télécharger - Bases de données