Reputation: 631
I have a php
page in this page i show data from mysql
database in a table also in the same page i have an HTML
form to do some search and the result of this search also appear in the same page.
Each row of this table have an icon delete
when i click this icon i delete the information of this row from mysql
database.
This my delete code
if(isset($_GET['delete'])){
$deleteid=secure($_GET['delete'],"num");
$checkQuery=mysqli_query($conn,"select column from table where column='$deleteid' limit 1")or die(mysqli_error($conn));
if(mysqli_num_rows($checkQuery)==1){
dbRowDelete("table","WHERE column='$deleteid'");
header("location:gm-tasks.php?msg=8");
}else{
header("location:gm-tasks.php");
}
}
An example of my show data and search code:
if(!isset($_POST['submit']) || isset($_POST['clear']) ){
//show all data
}
if(isset($_POST['submit'])) {
//Show search results
}
My question is how can after i delete a row to back to the search result.
I don't want after delete to show all data i want only to show the result of the search without the row i was delete.
I have tried this $_SERVER['http_referrer'];
but it didn't solve my problem
Upvotes: 0
Views: 562
Reputation: 943630
You have POST and GET backwards.
Upvotes: 5