Voilà j'ai mis Wamp5 sur mon ordi et j'ai le message suivant qui vient.
Erreur : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REMOTE_ADDR'] ; ?>')' at line 1
Mon code:
Code : Tout sélectionner
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>La Passion Parapente</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="820" border="0" cellpadding="0" cellspacing="0" align="center">
<tr><td width="10" background="image/mise_en_page/bordgaucheb.gif"> </td>
<td width="170" height="400" valign="top" bgcolor="#0066FF" >
<!-- Cadre menu gauche-->
<?php include("menuliens/liens.php"); ?>
<!-- fin des menu-->
</td>
<td width="2"></td><td align="center" valign="top" bgcolor="#FFFFFF"><br>
<!-- centre -->
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td width="10" background="image/cadre_du _centre/01.gif"><img src="images/trans.gif" width="9"></td><td width="580" background="image/cadre_du _centre/02.gif"><img src="image/mise_en_page/pixel.gif"></td><td width="23" background="image/cadre_du _centre/03.gif"><img src="image/mise_en_page/pixel.gif"></td>
</tr>
<tr><td height="100%" background="image/cadre_du _centre/04.gif"> <img src="image/mise_en_page/pixel.gif"></td>
<td background="image/cadre_du _centre/05.gif" class="mm">
<?php
$temps = date("H:i:s");
$delai = date ("Y-m-d");
include("include/confige.php");
if(isset($_GET['action'])) {
$action=$_GET['action'];
if($action=='supprimer'){
if(isset($_POST['bouton'])){
$bouton=$_POST['bouton'];
if($bouton){
$email = $_POST['email'];
$select = ("DELETE FROM newsletteradresse WHERE email= '$email'");
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$destinataire = "[email protected]";
$destinataire1 = "[email protected]";
$expediteur = $email;
echo '<div align="center"><span class="mm3"><br><br>Votre adresse e-mail à bien été supprimée.<br> Vous allez recevoir un mail de confirmation à l\'adresse suivante.<br>"'.$email.'"</span></div><br><br>';
mail($destinataire,
"leave [email protected]","inscription","From: $expediteur\r\nReply-To: $email","Cc: [email protected]\r\n");
mail($destinataire1,
"Désinscription de la newsletter"," $email c'est désinscrit de la newsletter","From: $expediteur\r\nReply-To: $email");
}
}
}
}
else {
$point = strpos($_POST['email'],".");
$aroba = strpos($_POST['email'],"@");
if( empty($_POST['email']) ) // si les champ pseudo ,sujet ou message sont vides
{
print'<div align="center"><span class="mm3"><br><br>Vous devez remplir le champs du formulaire avec votre adresse e-mail. Merci</span></div><br><br>';
print'<div align="center"><a href="javascript:history.back();" class="mm2">Cliquez ici pour compéter le formulaire</a></div>';
}
elseif ($point=='')
{
echo '<div align="center"><span class="mm3"><br><br>Votre email doit comporter un <b>point</b></span></div><br><br>';
print'<div align="center"><a href="javascript:history.back();" class="mm2">Cliquez ici pour compéter le formulaire</a></div>';
}
elseif ($aroba=='')
{
echo '<div align="center"><span class="mm3"><br><br>Votre email doit comporter un <b>@</b></span></div><br><br>';
print'<div align="center"><a href="javascript:history.back();" class="mm2">Cliquez ici pour compéter le formulaire</a></div>';
}
else{ // les champs sont ok, on insert dans la base
// on supprime les caractères spéciaux
$email = conv ($_POST['email']);
$ip = $_POST['ip'];
$select = "select id FROM newsletteradresse WHERE email='$email' ";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$res = mysql_num_rows($result);
if ($res!=0)
{
echo '<div align="center"><span class="mm3"><br><br>Votre adresse existe déjà dans notre base.</span></div><br><br>';
}
else
{
$select = "INSERT INTO newsletteradresse VALUES ('','$email','$ip')";
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
//on redirige le visiteur sur la page d'accueil, là ou s'afficheront les messages soit index.php
$destinataire1 = "[email protected]";
$destinataire = "[email protected]";
$expediteur = $email;
echo '<div align="center"><span class="mm3"><br><br>Votre adresse e-mail à bien été ajoutée.<br> Vous allez recevoir un mail de confirmation à l\'adresse suivante.<br>"'.$email.'"</span></div><br><br>';
mail($destinataire,
"join [email protected]","inscription","From: $expediteur\r\nReply-To: $email");
mail($destinataire1,
"Inscription à la newsletter"," $email c'est inscrit à la newsletter","From: $expediteur\r\nReply-To: $email");
}
//on ferme la connexion
mysql_close();
}
}
?>
</td>
<td background="image/cadre_du _centre/06.gif"> <img src="image/mise_en_page/pixel.gif"></td>
</tr>
<tr>
<td background="image/cadre_du _centre/07.gif"> <img src="image/mise_en_page/pixel.gif"></td><td background="image/cadre_du _centre/08.gif"> <img src="image/mise_en_page/pixel.gif"></td><td background="image/cadre_du _centre/09.gif"> <img src="image/mise_en_page/pixel.gif"></td>
</tr>
</table>
<!-- fin du centre-->
</td><td width="2"></td>
<td width="10" background="image/mise_en_page/borddroitb.gif"> </td>
</tr>
</tr>
<tr><td width="10" background="image/mise_en_page/coinbasdroit.gif" ></td><td width="170" bgcolor="#0066FF"></td><td width="2" bgcolor="#000099" ></td><td height="2" bgcolor="#000099"></td><td width="2" bgcolor="#000099" ></td><td width="10" background="image/mise_en_page/coinbasgauche.gif"></td>
</tr>
<tr><td width="10" background="image/mise_en_page/coinbasdroit.gif" ></td><td width="170" height="10" background="image/mise_en_page/bordbluebas.gif" ></td><td width="1" background="image/mise_en_page/bordbluebas.gif" ></td><td height="10" background="image/mise_en_page/bordbluebas.gif"></td><td width="1" background="image/mise_en_page/bordbluebas.gif" ></td><td width="10" background="image/mise_en_page/coinbasgauche.gif"></td>
</tr>
</table>
Merci bcp.[/code]