I'm trying to figure out how to call a PHP function with a html button as i understand so far i can't use javascript since it client side but would it work with jquery and how so?
Here my button
<button type="button" class="btn btn-default" data-dismiss="modal">Yes</button>
And here is my function in php
function confirmCloseTicket($conn) {
if (isset($_GET['deleteticketid'])) {
$id = $_GET['deleteticketid'];
$statuschange = "Closed Ticket";
$sql = "INSERT INTO closedtickets SELECT * FROM ticket WHERE ticketID = $id;";
$sql .= "DELETE FROM ticket WHERE ticketID = $id;";
$sql .= "UPDATE closedtickets SET status = '$statuschange' WHERE closedtickets.ticketID = $id;";
$result = mysqli_multi_query($conn, $sql);
if($result) {
header("location: http://localhost/ticketSystem/viewticket.php");
exit();
}else {
echo "failed";
}
}
}