home *** CD-ROM | disk | FTP | other *** search
/ csi.uticak12.org / csi.uticak12.org.tar / csi.uticak12.org / back / _delentry.php next >
PHP Script  |  2011-10-20  |  774b  |  21 lines

  1. <?
  2. include 'guard.php';
  3. mysql_connect(HostName,UserName,Password) or die("<html><body>Can not connect to MySql server!<br></body></html>");
  4. mysql_select_db (DBName) or die ("<html><body>Could not select database ".DBName."<br></body></html>");
  5.  
  6.  
  7. if ($mode=='cats') {
  8. $res=mysql_query("DELETE FROM `gal_cats` WHERE `id`='$id'");
  9. if (file_exists('cats/photo_'.$id.'.jpg')) {unlink ('cats/photo_'.$id.'.jpg');};
  10. echo '<script>location.href="cats.php?pn='.$pn.'"</script>'; 
  11. };
  12.  
  13.  
  14. if ($mode=='photos') {
  15. $res=mysql_query("DELETE FROM `gal_photos` WHERE `id`='$id'");
  16. if (file_exists('photos/photo_'.$id.'.jpg')) {unlink ('photos/photo_'.$id.'.jpg');};
  17. echo '<script>location.href="photos.php?pn='.$pn.'&cat_id='.$cat_id.'&title='.$title.'"</script>'; 
  18. };
  19.  
  20. ?>
  21.