Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
:) I am designing a php page and i need to incorporate the "like" button to the page. I tried using

document.getElementById("text").innerHTML="unlike";

and my link:
<a href="#" id="text" onclick="myFunction()">Like</a>

this only changes the text to "unlike".
Please any suggestions or like would be really appreciated

:)
Posted
Updated 2-Oct-13 23:22pm
v4

 
Share this answer
 
Comments
Emerald kwekowe 3-Oct-13 5:40am    
Thanks a lot i checked it out :)
[no name] 3-Oct-13 5:46am    
Glad to help..:)
What do you want your 'like' button to do? As an alternative you could always add a 'recommend this in google' button. Of course you need to create a goggle account for this.
 
Share this answer
 
Comments
Emerald kwekowe 3-Oct-13 5:20am    
thanks for the tip :) I need the button to "like" content on my pages not an external link like - Facebook like, twitter share or even recommend this on Google.. i want to do mine..
Jonathan Davies 3-Oct-13 5:37am    
To, for instance, display a count of 'likes' on your pages, you could to store the count in a MySQL database on your webserver. When your page is loaded read the value of that and display it. Also when the user clicks 'like' use jQuery and Ajax to call another .php page which will increment your count in the database and return the new count to be displayed. There are a lots of examples, tutorials and videos on doing these things around on the net.
Emerald kwekowe 3-Oct-13 5:38am    
thanks a lot i'll do just that. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900