Looking to build a like & dislike system for your website or application? This RU-vid video tutorial covers everything you need to know, from HTML and CSS for designing the interface, to JavaScript, PHP and MySQL for handling user interactions, processing and storing data on the server side. Follow this video to build your own like & dislike system! Source Code : - bit.ly/likedislikesystemdavidgtechpp (PayPal) - bit.ly/likedislikesystemdavidgtech (Gumroad) #2YearsOfDavidGTech
Hi @tannukumari2680, To store the user ID from login in a session, you should use the $_SESSION superglobal correctly. Here's the correct syntax: session_start(); // Start the session at the beginning of your PHP script $user_id = $_SESSION['user_id']; // Retrieve the user ID from the session Make sure you have session_start() at the top of all your PHP scripts where you want to access session variables.
Problem is solved but while clicking like button it's not working data like postid userid are showing in the inspect but when the button is clicked then it's not working
Hi @karmashow88, Thank you so much for the enthusiastic response! I'm thrilled to hear that you found the content helpful. If you have any questions or if there's anything specific you'd like to explore further, feel free to let me know. Your support means a lot! Happy coding! 😊🚀
Hi ! Thanks a lot for this video, it really helped me ! I just have a little issue i'd like to correct but i'm a complete beginner so it's hard for me to see the problem with my code.... When i've already liked or disliked, if i change to like/dislike the counter doesn't display, despite the fact that the like/dislike is well integrated into the database. The counter actually only appears when I unclick one button and then click the other, but not when I switch directly from one to the other. Additionally, even when it does appear, it's only on the side where I clicked but I would like both to be displayed when a button is clicked. I've been trying for a while, but I can't figure it out. I managed it once, but then the counter itself stopped working haha i'm maybe really dumb xD ! Can you help me figure out where the problem is,please? Thanks in advance (I'll put the code in the next comment)
Hi @gauthierr5513! I'm glad the video helped you! It sounds like the issue might be with how the counter updates in your JavaScript. Ensure that the like and dislike counters are correctly updating and refreshing the display after each action. If you can share your code, I can help you pinpoint the problem more effectively. Feel free to post the code in the next comment!
Thank you for your comment! It looks like you're encountering an issue with the '$' symbol not being defined. This error typically occurs when jQuery is not properly loaded or there might be an issue with the order in which your scripts are loaded. To resolve this issue, make sure that: You have included the jQuery library in your HTML file before your custom JavaScript code. You can do this by adding the following line before your script tags: Make sure that there are no typos or syntax errors in your JavaScript code. If you continue to experience issues, please share more details or your code, and I'd be happy to assist you further.
Hi @kucal8463, Thank you for reaching out and bringing this to my attention. I'm sorry to hear that you're having trouble with the likes button on the video. To better assist you, could you please provide more details about the issue you're facing? For example, are you encountering any error messages? Additionally, make sure you have a stable internet connection and try refreshing the page or clearing your browser cache. If the problem persists, I recommend checking the JavaScript console for any error messages. You can do this by right-clicking on the page, selecting "Inspect," and navigating to the "Console" tab. Any error messages there can help us pinpoint the issue. I'm here to help, so feel free to provide more information, and we'll work together to resolve the problem.