I am making an interactive ticket system. I have two pages: ticket.php and myaccount.php.
On the 'myaccount' page is a ticket management system where a admin can assign themselves tickets. What I want to do is when an admin views the ticket and makes a response and updates the status of the ticket on ticket.php, I want myaccount.php to reflect the update of the status (without refreshing the page of course).
As of now, my ajax call works and it gets the POST value from another page. However, I want to update the div in myaccount.php FROM ticket.php.
Here is the ajax which is stored in a file called action.js, this function is being called in ticket.php and I want it to update a div in myaccount.php:
function current_ticket() {
$.ajax({
type: "POST",
url: '../user/phpfunc/ajax.php',
data:{current_ticket: 'current_ticket_list'},
success:function(html) {
alert(html);
//This function is called in ticket.php. I want it to update a div
//in myaccount.php
}
});}
Here is the button being pressed that calls current_ticket() in ticket.php:
<input type="submit" name="submit" value="submit" onclick="current_ticket();">
Here is ajax.php as requested:
if(isset($_POST['current_ticket'])) {
echo 'test';}
I have looked for an answer and I can only find code which gets content FROM a div, but I want to send content TO a div in another file. Help is appreciated, thank you!!