1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I want to php script for Like/Dislike button ?

Discussion in 'PHP & Perl' started by hirephp, Jun 6, 2012.

Tags:
Thread Status:
Not open for further replies.
  1. hirephp

    hirephp Newbie

    Joined:
    Jun 9, 2011
    Messages:
    6
    Likes Received:
    0
    Home Page:
    I want to php script for Like/Dislike button ?
     
  2. zerodtk

    zerodtk Regular Member

    Joined:
    Jan 23, 2009
    Messages:
    210
    Likes Received:
    74
    Home Page:
    I want $1,000,000 per day
     
    • Thanks Thanks x 1
  3. Tensegrity

    Tensegrity Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 22, 2009
    Messages:
    1,824
    Likes Received:
    969
    I'm not going to give you the code cuz you're obviously super lazy and demanding. But I'll give you some tips.

    This is better off as an ajax script, but here is how you would do it in just PHP.

    Assuming you want users to like posts on a blog, create a column in your MySQL 'posts' table called 'like' and put a link on your post called 'like'. When they click it, send them to a script that runs the MySQL query to update that post and change the 'like' field to 'yes'. Now on your post, use mysql_num_rows to count how many likes it has.

    Hope this helps.

    If you're looking for a fb like script then you obviously haven't done a google search at all cuz there's 20 million pages about it.
     
Thread Status:
Not open for further replies.