0
next, on the page of each post has a button for "favorite", as I can check if the post has already been liked and change the name of the button to, for example, "favorite" and if it is not, when clicking the button would be done, but everything in the background, I have very shallow knowledge in javascript, but I know I will need ajax for this. I already built a small script in php/mysql that returns a json {"favorite":1}
when the post is already favoured or when it is changed to favoured, being its natural state {"favorite":0}
As it is only possible to bookmark while logged in to the site, the user id will be captured by Session, and the post id will be sent through the method POST
Ex:
<a href="site.com/post/favoritar">Favoritar</a>