Exemple #1
0
     $id = $_POST['id'];
     $name = trim($_POST['name']);
     $url = trim($_POST['url']);
     if ($name == '') {
         $error_string[] = $msg_favourites10;
     }
     if ($url == '' || $url == 'http://') {
         $error_string[] = $msg_favourites11;
     }
     if ($error_string) {
         error($msg_script5, $error_string, $msg_script7, $msg_charset);
     } else {
         include FOLDER_PATH . 'classes/class_favourites.inc.php';
         $MW_FAVE = new Favourites();
         $MW_FAVE->prefix = $database['prefix'];
         $MW_FAVE->update_fave_sql($_POST);
         updated($msg_favourites13, 'index.php?cmd=favourites&edit=' . $id, $msg_script4, $msg_script6, $msg_charset);
     }
 }
 //-----------------------
 // SCRIPT ACTION
 // Delete Favourites
 //-----------------------
 if (isset($_POST['remove'])) {
     $faveid = isset($_POST['faveid']) ? $_POST['faveid'] : '';
     if (!empty($faveid)) {
         mysql_query("DELETE FROM " . $database['prefix'] . "favourites \n                    WHERE id IN(" . implode(",", $faveid) . ")\n                    ") or die(mysql_error());
         updated($msg_favourites14, 'index.php?cmd=favourites', $msg_script4, $msg_script6, $msg_charset);
     }
     header("Location: index.php?cmd=favourites");
 }