j'ai changer d'hébergeur et depuis si je colle mon code dans mon champ l'update ne ce fait pas ....
voici le code
Code : Tout sélectionner
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
?>
<?php if (isset($_GET['id_newsletter'])) {
require_once('config.inc.php');
$val = intval($_GET['id_newsletter']);
$requete=mysql_query("SELECT objet, contenu FROM n_newsletters WHERE id_newsletter='$val'");
$result=mysql_query ($requete);
list($objetnews,$cont)=mysql_fetch_row($requete);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Modification newsletter</title>
</head>
<body>
<?php // ANTI-INJECTION SQL + XSS
function protection($valeur) {
$valeur = stripslashes($valeur);
$valeur = htmlspecialchars($valeur);
$valeur = htmlentities($valeur);
return @mysql_real_escape_string($valeur);
}
?>
<link rel="stylesheet" href="admin.css" type="text/css"/>
<form method="post" name="form1" action="PubLetter.php">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Modif objet:</td>
<td><input type="text" name="Objet" id="Objet" value="<?php echo "$objetnews"; ?>" size="106"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">Modif contenu:</td>
<td><textarea name="Contenu" id="Contenu" cols="80" rows="12"><?php echo "$cont"; ?></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="MAJ newsletter !"></td>
</tr>
</table>
</form>
<?php
require(config.inc.php);
if (isset($_POST['Objet']))
{
if(mysql_errno()==0)
{
if ($_POST['Objet']!="")
{
$valeur = protection($_POST['Objet']);
$val = intval($_GET['id_newsletter']);
mysql_query ("UPDATE n_newsletters SET objet='$valeur' WHERE id_newsletter='$val'");
}
}
}
if (isset($_POST['Contenu']))
{
if(mysql_errno()==0)
{
if ($_POST['Contenu']!="")
{
$valeur = protection($_POST['Contenu']);
$val = intval($_GET['id_newsletter']);
mysql_query ("UPDATE n_newsletters SET contenu='$valeur' WHERE id_newsletter='$val'");
}
}
}
if (isset($_POST['Objet']) || isset($_POST['Contenu']) )
{
echo "<meta http-equiv='Refresh' content='0;URL='modif_newsletter.php?id_newsletter='$val''>";
}
mysql_close();
?>
<b>Retour sous admin : </b><a href="admin_newsletter.php"><u>Admin</u></a></u></b>
</body>
</html>si je colle ceci
Code : Tout sélectionner
<div>
<div> </div>
<span style="font-family: Arial;"><font size="-1">
<table width="500" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td>
<div><span style="font-family: Courier New;"><span style="font-size: 10pt;">Bonjour,</span></span></div>
<span style="font-family: Courier New;"> <font size="2"><span style="font-size: 10pt;">Nous avons été plusieurs jours sans possibilité de communiquer via notre site internet ou nos adresses professionnelles, suite à quelques problèmes avec notre hébergeur net.</span></font></span> <span style="font-family: Courier New;"> <font size="2"><span style="font-size: 10pt;">Veuillez nous excuser pour cet inconvénient. </span></font></span> <span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">Les mails que vous avez pu nous envoyer durant cette période vous ont été retournés. Merci de nous les renvoyer si nécessaire.</span></font></p>
</span> <span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">Tout étant revenu à la normale, à très bientôt !</span></font></p>
</span> <span style="font-family: Courier New;">
<div><font size="2"><span style="font-size: 10pt;">L’équipe du <u>bbb</u>.</span></font></div>
</span>
<p> </p>
<span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">prochains évènements au <u>bbb</u> :</span></font></p>
</span> <span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">§ Vernissage ce mardi soir de l’exposition de Florence Garrabe, exposition visible jusqu’au 5 décembre</span></font></p>
</span> <span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">§ Petit salon de l’art contemporain « Mais qu’est-ce que je pourrai bien lui offrir ? #4 » vendredi 11 décembre de 17h à 22h, samedi 12 déc. de 14h à 18h | avec la sortie du livre d’artistes <i><span style="font-style: italic;">Play it again |</span></i> collectif | Editions bbb, fais-moi de l’art </span></font></p>
</span><span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">§ Exposition en ligne de Stéphane Benault, <i><span style="font-style: italic;">thesecretblock.over-blog.com</span></i></span></font></p>
</span> <span style="font-family: Courier New;">
<p><font size="2"><span style="font-size: 10pt;">§ Lancement de l’appel à projet <i><span style="font-style: italic;">Place publique</span></i></span></font></p>
</span><span style="font-family: Times New Roman;"> <span> <br />
</span></span></td>
</tr>
<tr>
<td>
<table width="500" cellspacing="0" cellpadding="1" border="0" align="center" style="">
<tbody>
<tr>
</tr>
<tr>
<td valign="top" align="left"><span style="font-family: Arial;"><font size="-1"> <span style="font-size: large;"><u><span style="font-family: Courier New;">bbb</span></u></span><span style="font-family: Courier New;"> centre d’art | centre régional d'initiatives pour l'art contemporain<br />
tél. : 05 61 13 37 14</span><u1:p></u1:p><span style="font-family: Courier New;"> <br />
<a target="_blank" href="http://www.lebbb.org">www.lebbb.org</a><br />
[email protected]</span></font></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td><span style="font-family: Arial;"><font size="-1"><span style="font-family: Arial;"><font size="-1"><br />
</font></span></font></span> </td>
</tr>
</tbody>
</table>
<br />
</font> </span></div>si qqun pouvez m'aider ?
Merci par avance