Here's my like button:
<form method="POST">
<input type="submit" value="Like">
<input type="hidden" name="IP" value="<?php $_SERVER["REMOTE_ADDR"]; ?>">
</form>
Here's the PHP:
if (!empty($_POST)) {
$connection = mysqli_connect("like");
$statement = mysqli_prepare($connection, "INSERT INTO Like (User, PageId) VALUES (?, ?)");
mysqli_stmt_bind_param($statement, "si", $_POST["IP"], $_GET["id"]);
mysqli_stmt_execute($statement);
exit;
}
Can I use a custom image instead of the standard button? And how do I display the amount of likes on the page?
I have two columns: IP and PageId.
Additionally, what is the "si" for? (didn't do that part myself).
Thanks!