?
| Current Path : /home/webyoo/www/backup/allback/kanity.com/save0807bh/ |
| Current File : /home/webyoo/www/backup/allback/kanity.com/save0807bh/modification.php |
<?php
include "start.php";
extract($_POST);
$err = 0;
$sel_photo = "";
if($photo!="")
{
$sel_photo=", photo='$photo'";
$extension=strrchr($photo,'.');
$os = array(".gif", ".jpeg", ".jpg", ".png", ".GIF", ".JPEG", ".JPG", ".PNG");
if (in_array($extension, $os)) {
$err = 0;
}else
{
$err = 1;
}
}
if($libelle=="" || $lien=="" || $commentaires=="" || $mots==""){
echo "Les champs obligatoires sont vides!";
}elseif($err == 1)
{
echo "L'image utilisée n'est pas au format requis!";
}else{
/* $date = date("d-m-Y");
$timestamp = strtotime($date); */
$sql_insert=mysql_query("UPDATE kan_posts SET libelle='".addslashes($libelle)."', lien='$lien', commentaires='".addslashes($commentaires)."', mots='".$mots."' $sel_photo WHERE id=$id");
echo "Modification réussie!";
}
?>