homepage Welcome to WebmasterWorld Guest from 54.204.182.118
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Facebook Like button visibility control
hide Like button if visitor is not a Facebook member
nimonogi

5+ Year Member



 
Msg#: 4152234 posted 8:40 am on Jun 14, 2010 (gmt 0)

Hello,

I have successfully embed a Facebook Like button to my ecommerce website.
Visitors can click Like on each product and a link is posted on their facebook's profile page.

What i want is to control the visibility of the button...
For ex. If the visitor does not have a facebook cookie (i'm not sure which cookie determines that the visitors is a facebook member), i don't want the Like button to appear.

Any ideas on how to do that?

Thanks.

 

Matthew1980

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4152234 posted 9:47 am on Jun 14, 2010 (gmt 0)

Hi there nimonogy,

You need a conditional clause, once you know the name of the cookie you just say something like:-
If(cookie is set){
//Show button
}

No need for an else clause as you only need the condition to evaluate true if cookie set.

Cheers
MRb

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4152234 posted 4:45 pm on Jun 14, 2010 (gmt 0)

If the visitor does not have a facebook cookie


Security policy of browsers will not allow you to read a cookie set by another site. This can't be done (and if there's a way, it's only a "black hat" way.) Imagine what would happen if I could read all the cookies in your browser from my web site. Well not me, but . . . yeah.

FourDegreez

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4152234 posted 4:39 am on Jun 15, 2010 (gmt 0)

If it is possible at all, the place to find the answer would be the facebook developer forums.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved