bonjour et mes meilleurs voeux pour 2008
bien j'ai teste en or die mais aucune erreur ce presente
je redonne mon code, j'ai surement loupe quelque chose
<?
include('includes/config.php');
$connect=mysql_connect($host, $user,$password);
$connect_bd=mysql_select_db($bdd);
$table="client";
$table2="client_contact";
$table3="client_projet";
$date=date("Y-m-d");
$heure = date("H:i");
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$IP = $_SERVER['HTTP_X_FORWARDED_FOR'];
elseif(isset($_SERVER['HTTP_CLIENT_IP']))
$IP = $_SERVER['HTTP_CLIENT_IP'];
else
$IP = $_SERVER['REMOTE_ADDR'];
$modulaire = $_POST['piscine_modulaire'];
$coque = $_POST['piscine_coque'];
$abri = $_POST['abris_piscine'];
$projet = $_POST['projet'];
$mois = $_POST['mois'];
$mail = $_POST['email'];
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$adresse = $_POST['adresse'];
$cp = $_POST['cp'];
$ville = $_POST['ville'];
$tel = $_POST['telephone'];
$date_contact = $_POST['date_contact'];
$heure_contact=$_POST['heure_contact'];
$msg=$_POST['msg'];
$result = mysql_query("SELECT id_client FROM $table ORDER BY id_client DESC LIMIT 0,1");
$row = mysql_fetch_array($result);
$id_client_0=$row["id_client"];
$id_client_1=$row["id_client"]+1;
$res=0;
$titres=0;
$sql = "SELECT distinct id FROM $table WHERE nom='$nom' and prenom='$prenom' and cp='$cp' and ville='$ville'";
$req = mysql_query($sql);
$res= mysql_num_rows($req);
if ($res<=1) {
// remplir bd
$titre="MERCI D'AVOIR REMPLI LE FORMULAIRE.";
$titres='0';
$remplir1="INSERT INTO $table(id,id_client,ip,date,heure,nom,prenom,adresse,cp,ville,tel,email) VALUES('$id_client_1','$id_client_1','$IP','$date','$heure','$nom','$prenom','$adresse','$cp','$ville','$tel','$mail')";
$req1 = mysql_query($remplir1) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$remplir2="INSERT INTO $table2(id_client,date,heure,commentaire) VALUES('$id_client_1','$date_contact','$heure_contact','$msg')";
$req2 = mysql_query($remplir2) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$remplir3="INSERT INTO $table3(id_client,piscine_beton,piscine_coque,abris_piscine,projet,periode) VALUES('$id_client_1','$modulaire','$coque','$abri','$projet','$mois')";
$req3 = mysql_query($remplir3) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
//ajouter envois mail html personnalise php
include('includes/mail.php');
//fin envois mail html personnalise php
}
else{
$titre="Vous avez déja fait une demande de doc.<br>Si ce n'était pas le cas, merci de nous appeler.";
}
mysql_query("OPTIMIZE TABLES {$table};");
mysql_query("OPTIMIZE TABLES {$table2};");
mysql_query("OPTIMIZE TABLES {$table3};");
mysql_close ($connect);
?>
<table border="0" width="100%" id="table1" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" height="1">
<img border="0" src="images/logo-piscine-capblue.gif" width="299" height="116">
</td>
<td width="315" rowspan="3" align="center" valign="top">
<table border="0" width="100%" id="table2" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="10" bgcolor="#FC5187">
<p style="margin:10px; " align="center">
<b><font face="arial" size="2" color="#000080">
<?echo"$titre";?>
</font></b></p></td>
</tr>
<tr>
<td align="justify" <?if ($res<=1){}else{?>background="images/capblue-piscine.gif"<?}?>>
<font face="MS Sans Serif" size="1">
<p style="margin:10px; ">
<?
if ($res<=1){
echo "Bonjour Mme, Mr <b> $prenom $nom</b>,\n nous allons vous faire parvenir le(s) catalogue(s) :";
echo "<br />";
echo "<ul>";
if ($modulaire !="") {
echo"<li> catalogue piscine modulaire</li>";
}
if ($coque !="") {
echo"<li> catalogue piscine monocoque</li>";
}
if ($abri !="" ){
echo"<li> catalogue abri de piscine</li>";
}
echo "</ul>";
echo "<br />";
echo " à l'adresse suivante :";
echo "<br />";
echo "<br />";
echo "<b> $prenom $nom</b>";
echo "<br />";
echo "<b>$adresse</b>";
echo "<br />";
echo "<b>$cp $ville</b>";
echo "<br />";
echo "<br />";
echo "Un mail de confirmation avec la synthèse des renseignements founis vous à été envoyé à l'adresse mail suivante :";
echo "<br />";
echo "<br />";
echo "<b>$mail</b>";
}
else{
}
?>
</p></font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<p style="margin-left: 30px; margin-top: 10px"><b>
<font color="#000080" face="Arial">Pour nous contacter</font></b></p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0"><b>
<font size="2" face="Arial"><font color="#000080">SNPI- </font>
<a target="_self" href="http://www.toto.fr/"><font color="#000080">toto</font></a><font color="#000080"> <br>
</font>
</font></b><font face="MS Sans Serif" size="2">Siège social :<br>
adresse<br>
adresse<br>
ville- France<br>
</font><br>
<font size="2" face="MS Sans Serif">Tél. </font>
<span style="font-size: 9.0pt; font-family: MS Sans Serif">tel</span><font size="2" face="MS Sans Serif"><br>
Fax </font><span style="font-size: 9.0pt; font-family: MS Sans Serif">
fax</span></p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0">
<span style="font-family: MS Sans Serif; font-size: 9pt">@mail :
<a href="mailto:[email protected]">[email protected]</a></span></p>
<p style="margin-left: 30px"> </td>
</tr>
<tr>
<td align="left" valign="bottom" height="1">
</td>
</tr>
</table>
merci d'avance de vos reponses
bonjour et mes meilleurs voeux pour 2008
bien j'ai teste en or die mais aucune erreur ce presente
je redonne mon code, j'ai surement loupe quelque chose
[php]
<?
include('includes/config.php');
$connect=mysql_connect($host, $user,$password);
$connect_bd=mysql_select_db($bdd);
$table="client";
$table2="client_contact";
$table3="client_projet";
$date=date("Y-m-d");
$heure = date("H:i");
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$IP = $_SERVER['HTTP_X_FORWARDED_FOR'];
elseif(isset($_SERVER['HTTP_CLIENT_IP']))
$IP = $_SERVER['HTTP_CLIENT_IP'];
else
$IP = $_SERVER['REMOTE_ADDR'];
$modulaire = $_POST['piscine_modulaire'];
$coque = $_POST['piscine_coque'];
$abri = $_POST['abris_piscine'];
$projet = $_POST['projet'];
$mois = $_POST['mois'];
$mail = $_POST['email'];
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$adresse = $_POST['adresse'];
$cp = $_POST['cp'];
$ville = $_POST['ville'];
$tel = $_POST['telephone'];
$date_contact = $_POST['date_contact'];
$heure_contact=$_POST['heure_contact'];
$msg=$_POST['msg'];
$result = mysql_query("SELECT id_client FROM $table ORDER BY id_client DESC LIMIT 0,1");
$row = mysql_fetch_array($result);
$id_client_0=$row["id_client"];
$id_client_1=$row["id_client"]+1;
$res=0;
$titres=0;
$sql = "SELECT distinct id FROM $table WHERE nom='$nom' and prenom='$prenom' and cp='$cp' and ville='$ville'";
$req = mysql_query($sql);
$res= mysql_num_rows($req);
if ($res<=1) {
// remplir bd
$titre="MERCI D'AVOIR REMPLI LE FORMULAIRE.";
$titres='0';
$remplir1="INSERT INTO $table(id,id_client,ip,date,heure,nom,prenom,adresse,cp,ville,tel,email) VALUES('$id_client_1','$id_client_1','$IP','$date','$heure','$nom','$prenom','$adresse','$cp','$ville','$tel','$mail')";
$req1 = mysql_query($remplir1) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$remplir2="INSERT INTO $table2(id_client,date,heure,commentaire) VALUES('$id_client_1','$date_contact','$heure_contact','$msg')";
$req2 = mysql_query($remplir2) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$remplir3="INSERT INTO $table3(id_client,piscine_beton,piscine_coque,abris_piscine,projet,periode) VALUES('$id_client_1','$modulaire','$coque','$abri','$projet','$mois')";
$req3 = mysql_query($remplir3) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
//ajouter envois mail html personnalise php
include('includes/mail.php');
//fin envois mail html personnalise php
}
else{
$titre="Vous avez déja fait une demande de doc.<br>Si ce n'était pas le cas, merci de nous appeler.";
}
mysql_query("OPTIMIZE TABLES {$table};");
mysql_query("OPTIMIZE TABLES {$table2};");
mysql_query("OPTIMIZE TABLES {$table3};");
mysql_close ($connect);
?>
<table border="0" width="100%" id="table1" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" height="1">
<img border="0" src="images/logo-piscine-capblue.gif" width="299" height="116">
</td>
<td width="315" rowspan="3" align="center" valign="top">
<table border="0" width="100%" id="table2" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="10" bgcolor="#FC5187">
<p style="margin:10px; " align="center">
<b><font face="arial" size="2" color="#000080">
<?echo"$titre";?>
</font></b></p></td>
</tr>
<tr>
<td align="justify" <?if ($res<=1){}else{?>background="images/capblue-piscine.gif"<?}?>>
<font face="MS Sans Serif" size="1">
<p style="margin:10px; ">
<?
if ($res<=1){
echo "Bonjour Mme, Mr <b> $prenom $nom</b>,\n nous allons vous faire parvenir le(s) catalogue(s) :";
echo "<br />";
echo "<ul>";
if ($modulaire !="") {
echo"<li> catalogue piscine modulaire</li>";
}
if ($coque !="") {
echo"<li> catalogue piscine monocoque</li>";
}
if ($abri !="" ){
echo"<li> catalogue abri de piscine</li>";
}
echo "</ul>";
echo "<br />";
echo " à l'adresse suivante :";
echo "<br />";
echo "<br />";
echo "<b> $prenom $nom</b>";
echo "<br />";
echo "<b>$adresse</b>";
echo "<br />";
echo "<b>$cp $ville</b>";
echo "<br />";
echo "<br />";
echo "Un mail de confirmation avec la synthèse des renseignements founis vous à été envoyé à l'adresse mail suivante :";
echo "<br />";
echo "<br />";
echo "<b>$mail</b>";
}
else{
}
?>
</p></font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<p style="margin-left: 30px; margin-top: 10px"><b>
<font color="#000080" face="Arial">Pour nous contacter</font></b></p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0"><b>
<font size="2" face="Arial"><font color="#000080">SNPI- </font>
<a target="_self" href="http://www.toto.fr/"><font color="#000080">toto</font></a><font color="#000080"> <br>
</font>
</font></b><font face="MS Sans Serif" size="2">Siège social :<br>
adresse<br>
adresse<br>
ville- France<br>
</font><br>
<font size="2" face="MS Sans Serif">Tél. </font>
<span style="font-size: 9.0pt; font-family: MS Sans Serif">tel</span><font size="2" face="MS Sans Serif"><br>
Fax </font><span style="font-size: 9.0pt; font-family: MS Sans Serif">
fax</span></p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-left: 30px; margin-top: 0; margin-bottom: 0">
<span style="font-family: MS Sans Serif; font-size: 9pt">@mail :
<a href="mailto:
[email protected]">
[email protected]</a></span></p>
<p style="margin-left: 30px"> </td>
</tr>
<tr>
<td align="left" valign="bottom" height="1">
</td>
</tr>
</table>
[/php]
merci d'avance de vos reponses