Hello! First and foremost thank you for checking out my problem, and for any help you may give!
Okay, so like the title says I'm in need of calling a php function from my index page, which adds a new record in my database as a vote, using JQuery Ajax. This function will return one integer, which will then be printed inside the form button in which it was called from.
Anyone have an idea on how I would accomplish this? Any guidance is appreciated!
Edit:
So if I'm using a template object I can just call the
function using ajax and it will return the output?
What would I use as the URL? index.php?
Such as...
function DoVote() {
$.ajax({
type:'POST',
url: 'index.php',
success: function(data) {
$('#voteText').html(data);
}
});
And the form action attribute is posted I'm guessing?