I have a like button. The php behind it works as it should. But it refreshes the page. Is it possible to write a javascript between the HTML and the PHP? For example: HTML:
<input type="button" id="like_button"><img src="images/like.png"><?php echo $getVideo["likes"];?></button>
And when clicking on that button, the javascript triggers the file like_button.php, which looks like this:
<?php
require_once "data_inc/database.php";
$like = new videos();
$like->likeButton($_GET["id"]);
No link out there shows how it would look like, while having OOP php. If someone could provide a javascript, it would help everyone who are currently facing this. How would the javascript look like? Thanks.