Bonsoir
Bon j'ai un problème entre ma page et l'insertion dans la bdd
Voila le code :
---------------
if(isset($_POST['fiche_titre']) || isset($_POST['fiche_description']) || isset($_POST['fiche_editeur']) || isset($_POST['fiche_type']) || isset($_POST['fiche_sortie']) || isset($_POST['fiche_age']))
{
$_POST['fiche_description'] = str_replace('\r\n', "\r\n", $_POST['fiche_description']);
$err = NULL;
if(strlen($_POST['fiche_titre']) >= 3 && strlen($_POST['fiche_titre']) <= 500)
{
if(!empty($_POST['fiche_description']) && strlen($_POST['fiche_description']) <= 5000)
{
$_POST = array_map('mysql_real_escape_string', $_POST);
mysql_query('INSERT INTO forum_fiche (fiche_titre, fiche_description, fiche_editeur, fiche_type, fiche_sortie, fiche_age) VALUES ("'.$_POST['fiche_titre'].'" , "'.$_POST['fiche_description'].'" , "'.$_POST['fiche_editeur'].'" , "'.$_POST['fiche_type'].'" , "'.$_POST['fiche_sortie'].'" , "'.$_POST['fiche_age'].'" , 0 ');
$ok = 'La fiche du jeu a bien été ajoutée !';
}
else $err = 'Votre texte est vide ou trop long.';
}
else $err = 'Le titre est invalide.';
}
include($_SERVER["DOCUMENT_ROOT"].'/header.php');
if(!empty($ok))
{
echo '<div class="form_err">'.$ok.'</div>
<p><a class="lienbase" href="admin_news_add.php">Ajouter une autre news</a></p>
<p><a class="lienbase" href="admin_news.php">Retour à la gestion des news</a></p>';
}
else
{
echo '<div class="titre"><h3>Ajouter un jeu</h3></div>
<div class="bloc">';
if(!empty($err))
{
echo '<p><strong class="erreur">'.$err.'</strong></p>';
}
?>
<form method="post" action="admin_fiche_add.php" id="form_news" name="form_post">
<table>
<tr>
<td><label for="titre" class="erreur">Nom du jeu :</label></td>
<td><input type="text" name="fiche_titre" id="fiche_titre" value="<?php if(!empty($_POST['fiche_titre'])) echo afficher($_POST['fiche_titre']); ?>" /></p>
</td>
etc....
Merci de votre aide 