So basically I have the following code:
if(isset($_GET['deleteid'])) {
$delete = $_GET['deleteid'];
$denyrequest = "DELETE FROM wp_refundrequests WHERE request_id = $delete";
}
$requests = $wpdb->get_results("SELECT * FROM wp_refundrequests", ARRAY_A);
foreach ($requests as $row) {
echo "<li>" . $row['product_name'] . " " .
"<a href='admin-page?deleteid=" . $row['request_id'] . "'>Deny</a></li>" .
"<a href='admin-page?acceptid=" . $row['request_id'] . "'>Accept</a></li>";
}
Where if users clicks either Deny or Accept on the list of items, it adds a parameter to the URL and with that parameter, deletes the wanted row from the database. Currently however after pressing on any of the Deny (Or Accept) links, the result is the following, where there is a slash before the parameter:
I have done the same kind of code to delete DB data using a list once before, but it was without WordPress and I had no problems by just linking the file normally. The deletion doesn't go through and I'm assuming that this is the cause.
Basically at the moment nothing happens other than the URL looks like that.
Thank you in advance!