50cent Posted June 24, 2011 Share Posted June 24, 2011 Hi all,I've been trying to work this out but I'm not getting anywhere.I want to display our SSL site seal only on secure 'https' pages.I therefore need to be able to write the following in smarty header.tpl:{if https} xxx {/if}I've tried: {if $HTTP_SERVER_VARS['HTTPS'] == "ON"} display content {/if} {if $HTTP_SERVER_VARS['HTTPS']} display content {/if} {if $https} display content {/if} But it's not working. Can anybody help?Cheers! Link to comment Share on other sites More sharing options...
otzy Posted June 24, 2011 Share Posted June 24, 2011 add line to init.php: $smarty->assign('server_protocol',$_SERVER['SERVER_PROTOCOL']); then you can use variable $server_protocol in any tpl file Link to comment Share on other sites More sharing options...
50cent Posted June 24, 2011 Author Share Posted June 24, 2011 Thanks for your reply.I tried your method - however it returns 'https' even on pages where the address begins 'http'.So in the end I have solved the issue using java_script: [removed]{literal} var addy = [removed].href; if((addy.substring(0,5) == 'https')) { [removed]("[removed]<\/script>"); } {/literal}[removed] Cheers50cent Link to comment Share on other sites More sharing options...
otzy Posted June 24, 2011 Share Posted June 24, 2011 ah, yes$_SERVER['SERVER_PROTOCOL'] always returns 'HTTP/1.0'you need to use $_SERVER['HTTPS'] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now