Good night everyone, I have a PHP script that creates a table in which, on this page is run an ajax script and gives real time to see who is in the database ... in this table I have a delete button for each person and when clicking a variable is created $ _GET with the process number (eg searchstudent.php? usrdelete = 5382)
AJAX:
$('#textbox').keyup(function(){
$("#display_students").text('');
var name = $('#textbox').val();
if($.trim(name) != ''){
$.post('../core/Query/students/student_search.php', {st_process: name}, function(data){
$("#display_students").append(data);
});
}
});
PHP:
<?php
if(isset($_POST['st_process']) === true && empty($_POST['st_process']) === false){
include("../Query-core.php");
include('../db.php');
$authentication = new DBRequest($host = 'localhost',
$user = 'root',
$pass = '',
$db = 'contas');
$selectedstudents = $authentication->selectionQueryLike("alunos", $authentication->e(trim($_POST['st_process'])), "student_process");
if(mysqli_num_rows($selectedstudents) > 0){
echo "<table><tr><th>Nome</th><th>NºProcesso</th><th>ID</th><th>Apagar</th></tr>";
while($row = $selectedstudents->fetch_assoc()){
echo "<tr>";
echo "<td><a href='#'>" . $row["student_name"] . "</a></td>";
echo "<td>" . $row["student_process"] . "</td>";
echo "<td>" . $row["student_ID"] . "</td>";
echo "<td><a href=?usrdelete=" . $row["student_ID"] . ">Delete<a/></td>";
echo "</tr>";
}
echo "</table>";
}
}
?>
How could I pass both $ _GET and $ _POST in ajax simultaneously?