Friday, October 21, 2011

Menghapus File dengan PHP

Terkadang kita kesulitan dalam penghapusan file yang ada di website kita, oke setelah beberapa kali mencoba, Q mendapatkan formasi sebagai berikut :
if($_GET[go]=="del") {
if(@unlink("dokument/".$_GET['files'])) {
$sql_dele = "delete from dokumentasi where NIP ='$_SESSION[nik]' AND urllink='$_GET[files]'";
if(!mysql_query($sql_dele)){ echo $filedele."
Gagal di hapus!,
".mysql_error(); }
else { echo "Proses hapus data ".$_GET[files]." Berhasil"; }
}
}
Oke deh !!!, hanya sekedar catatan untuk mengingatkan diri sendiri, maklum umur dah mulai tuha ha ha ha ha ha

No comments:

Post a Comment