1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| if(isset($_GET['action']) && $_GET['action'] == 'add'){
include('../include/connect.inc.php');
$newart = substr($row_news['news_texte'], 0, 150);
$pos = strrpos($_POST['html_value'], " ");
$resum = substr($newart, 0, $pos);
if ((isset($_POST['html_value'])) && (!empty($_POST['html_value'])) && (isset($_POST['nom_actu'])) && (!empty($_POST['nom_actu'])) && (isset($_POST['actu'] == 1)) && (isset($_POST['flash'] == 0))){
$query = mysql_query("INSERT INTO actu (num_actu, nom_actu, date_actu, auteur_actu, contenu_actu, resum_actu) VALUES ('','".$_POST['nom_actu']."','".$date."','".$_SESSION['pseudo_']."','".$_POST['html_value']."','".$resum."')");
$_SESSION['error'] = '<p>L\'ajout á été réalisé !</p>';
}
elseif (isset($_POST['html_value']) && !empty($_POST['html_value']) && isset($_POST['nom_actu']) && !empty($_POST['nom_actu']) && isset($_POST['actu'] == 0) && isset($_POST['flash'] == 1)){
$query = mysql_query("INSERT INTO flash (num_flash, nom_flash, date_flash, auteur_flash, contenu_flash) VALUES ('','".$_POST['nom_actu']."','".$date."','".$_SESSION['pseudo_']."','".$_POST['html_value']."')");
$_SESSION['error'] = '<p>L\'ajout á été réalisé !</p>';
header("location: ajout_article.php");
}
else {
$_SESSION['error'] = '<p>Remplissez tous les champs !</p>';
header("location: ajout_article.php");
}
mysql_close();
} |
Partager