0
How to execute php function through ajax and then return the answer from php?
I decided to create a blog where the admin posts all sorts of different news. Each news item has a number of likes and views and when I click on the like button it is placed, but the page is completely reloaded. Most recently, I learned that using ajax can execute php script without refreshing the page. And I have a question, "how?". I dug through the entire Internet, but not found the answer or if found, then simply not understood. Could anyone who knows how to write me the example code and that php is returned and displayed on the data page after the script execution type: <?php if($like=='1'){ echo ' Like delivered!'; }else{ echo 'an error Occurred!'; } ?>
2 Respostas
0
@kaliki chandu Thank you