MySQL Forums
Forum List  »  PHP

Re: Fault: Data is deleted automatically.
Posted by: Samet Karaca
Date: July 22, 2020 07:49PM

Delete command in PHP page:

<a onclick="return dikkat()" href="tum-uyeler.php?sil=<?php echo $sonuc['id']?>"><i class="nav-icon fas fa-trash"></i></a>

Onclick Function:

function dikkat(){
	  var agree=confirm("Bu içeriği silmek istediğinizden emin misiniz?\nBu işlem geri alınamaz!");
	 if (agree) {
	  return true ; 
	  }
	 else {
	  return false ;
	  }
	}


Database Query:

if(isset($_GET['sil'])){

$sil = $db->prepare("DELETE FROM uyeler WHERE id = :id");
$delete = $sil->execute(array('id' => $_GET['sil']));
header('Location: tum-uyeler.php');

}

These codes are working properly. However, when I visit the site a few days later, I see that all the data in the "uyeler" table have been deleted.

Options: ReplyQuote


Subject
Written By
Posted
Re: Fault: Data is deleted automatically.
July 22, 2020 07:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.