klox7 Posted October 25, 2010 Share Posted October 25, 2010 I'm thinking of putting "external elements" (ex. Facebook Like Box) on site but in the same time I'm asking myself if it can be done for https pages using SSL and if there are any issues regarding security. I'm aware that if you have http links to scripts or images on your https pages browsers will notify user about "unsecure items" with pop-up (especially IE). Is there any way to work something out? Or maybe display "external elements" only when browsing http pages? Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted October 25, 2010 Share Posted October 25, 2010 I'm thinking of putting "external elements" (ex. Facebook Like Box) on site but in the same time I'm asking myself if it can be done for https pages using SSL. I'm aware that if you have http links to scripts or images on your https pages browsers will notify user about "unsecure items" with pop-up (especially IE). Is there any way to work around it? Or maybe display "external elements" only when browsing http pages? If you put a FB button in your header or footer then you will have to use a conditional to determine when you are in SSL and simply not include it on SSL pages. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
klox7 Posted October 25, 2010 Author Share Posted October 25, 2010 Since I'm new at this can you please tell me if something like this will work function isHttps() { return isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off'); } Thanks Link to comment Share on other sites More sharing options...
germ Posted October 25, 2010 Share Posted October 25, 2010 This works: <?php if ( $request_type == 'NONSSL' ) { ?> ******** DELETE THIS LINE AND PUT YOUR "NON-SECURE" CODE HERE ******** <?php } ?> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
klox7 Posted October 26, 2010 Author Share Posted October 26, 2010 Thanks again! If enyone want's to put simple iframe version of fb like box only on http pages and exclude it on https pages below is the whole code. <?php if ( $request_type == 'NONSSL' ) { ?> <iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2FYourFacebookPage&width=200&colorscheme=light&connections=0&stream=false&header=false&height=80" scrolling="no" frameborder="0" style="border:1px solid #94A3C4; background-color:#ECEFF5; overflow:hidden; width:200px; height:80px;" allowTransparency="true"></iframe> <?php } ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.