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
| <?PHP
$db = mysql_connect('HOST', 'NOM DE LA BASE DE DONNEES', 'MOT DE PASSE');
mysql_select_db('NOM DE LA BASE DE DONNEES',$db);
$sql = "INSERT INTO NOM DE LA TABLE
VALUES('$quand','$vous_etes','$departement_expediteur','$raison_sociale','$nom','$prenom','$cp','$ville','$mail','$tel','$message')";
mysql_query($sql)
or die('Erreur SQL !'.$sql.'
'.mysql_error());
?>
<?php
$TO = "ADRESSE MAIL";
$_POST['titre']="TITRE DE LA PAGE;)";
$h = "From: " . $TO;
$message = "";
while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}
mail($TO, $subject, $message, $h);
$_POST[mail];
?>
3)-->
<?php
$db = mysql_connect('HOST', 'NOM DE LA BASE DE DONNEES', 'MOT DE PASSE');
mysql_select_db('NOM DE LA BASE DE DONNEES',$db);
$sql = 'SELECT * FROM NOM DE LA TABLE';
$req = mysql_query($sql) or die('Erreur SQL !
'.$sql.'
'.mysql_error());
while($data = mysql_fetch_array($req))
{
echo "<div align=\"center\"><center>
<table border=\"1\">
<tr>
<td>";
echo $data['quand'];
echo "</td>
<td>";
echo $data['vous_etes'];
echo "</td>
<td>";
echo $data['nom'];
echo "</td>
<td>";
echo $data['prenom'];
echo "</td>
<td>";
echo $data['departement_expediteur'];
echo "</td>
<td>";
echo $data['raison_sociale'];
echo "</td>
<td>";
echo $data['cp'];
echo "</td>
<td>";
echo $data['ville'];
echo "</td>
<td> ";
echo $data['mail'];
echo "</td>
<td> ";
echo $data['tel'];
echo "</td>
<td> ";
echo $data['message'];
echo "</td>
</tr>
</table>
</center></div>";
}
mysql_close();
?>
<?
$table="formulaire";
$quand=""; if(!empty($_POST["quand"]))
$nom=addslashes($_POST["quand"]);
$vous_etes=""; if(!empty($_POST["vous_etes"]))
$nom=addslashes($_POST["vous_etes"]);
$nom=""; if(!empty($_POST["nom"]))
$nom=addslashes($_POST["nom"]);
$prenom=""; if(!empty($_POST["prenom"]))
$nom=addslashes($_POST["prenom"]);
$departement_expediteur=""; if(!empty($_POST["departement_expediteur"]))
$nom=addslashes($_POST["departement_expediteur"]);
$raison_sociale=""; if(!empty($_POST["raison_sociale"]))
$nom=addslashes($_POST["raison_sociale"]);
$cp=""; if(!empty($_POST["cp"]))
$nom=addslashes($_POST["cp"]);
$ville=""; if(!empty($_POST["ville"]))
$nom=addslashes($_POST["ville"]);
$mail=""; if(!empty($_POST["mail"]))
$nom=addslashes($_POST["mail"]);
$tel=""; if(!empty($_POST["tel"]))
$nom=addslashes($_POST["tel"]);
$message=""; if(!empty($_POST["message"]))
$nom=addslashes($_POST["message"]);
// Ajoute la nouvelle fiche
$query = "INSERT INTO $table(quand,vous_etes,nom,prenom,departement_expediteur,raison_sociale,cp,ville,mail,tel,message)";
$query .= " VALUES('$quand','$vous_etes','$nom','$prenom','$departement_expediteur','$raison_sociale','$cp','$ville','$mail','$tel','$message')";
?> |
Partager