A
A
Alexander Timofeev2015-08-12 12:06:24
JavaScript
Alexander Timofeev, 2015-08-12 12:06:24

How to make your own likes on the site?

It is just necessary that the visitor can like once from his ip and it would be saved after reloading the page. Nothing else needs to be done with these likes.

UPD: The possibility that a person can log in from another computer and vote again is not critical!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Taratin, 2015-08-12
@Taraflex

If the site is not very popular, then the following scripts will suffice to exclude the possibility of voting twice.
https://github.com/Valve/fingerprintjs2
+
https://github.com/samyk/evercookie/ (before installation, rename all scripts so that they are not blocked by adblock)
Forget about binding to ip.

P
Pavel Kononenko, 2015-08-12
@premas

This is done on the server.

S
Stanislav Fateev, 2015-08-12
@svfat

They need to be saved somewhere (in the database) - i.e. one frontend is not enough. Ajax requests are used. The implementation from the frontend is something like this:

$('#like').click(function(e)
    {
        $.post
            ....
    });

And on the backend, already process and check the IP for duplicates - it depends on the chosen platform. By the way, if you check by IP - all users behind NATs will not be able to use your likes normally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question