Welcome to WebmasterWorld Guest from 54.146.201.80

Forum Moderators: httpwebwitch & not2easy

Message Too Old, No Replies

Like Button SSL Error

     
8:42 pm on Jun 27, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 19, 2005
posts:117
votes: 0


I've looked and looked but still can't seem to solve this issue. When a customer logs into the SSL side of the cart they get an error due to the little Facebook "F" in the like button. I've tried adding the "https" to the url in the iframe code and even eliminating it and going with just "//" as someone suggested. Still gets the same "parts of page not secure" warning. Is there an easy fix to this I'm simply missing?
1:35 am on June 28, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 19, 2005
posts:117
votes: 0


Actually found this on another site finally. It took me a while to find it so I'm posting my solution in case other people are having the same problem. Maybe I'm just slow....

when I want external http content to disappear on https pages I enclose the external content like this:

PHP Code:
<?php if (!$_SERVER['HTTPS']){ ?>
<!-- external content here -->
<?php } ?>

I use this code to display social bookmarking widgets only on http pages and not on https pages.


This works to get rid of the error by removing the button on secure pages completely.
1:36 am on June 28, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 19, 2005
posts:117
votes: 0


Obviously only works on PHP pages though....
2:24 am on June 28, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:June 14, 2010
posts:985
votes: 0


Well to add to your solution, it'll work on any page including vanilla .htm or .html by simply adding this line to the beginning of an .htaccess file or in the apache .conf file:

AddType application/x-httpd-php .htm .html

That tells Apache to parse for PHP scripting within documents with that file extension.