Jump to content

Capture current URL and secure status?


Recommended Posts

Basically, I'm doing this now using a PHP hack, and I'm wondering if there's a way I can do it "better" with Smarty.

 

For secure status right now I have:

 

{php}

$https = isset($_SERVER['HTTPS']);

if ($https)

{

{/php}

<secure code>

{php}

}

else

{

{/php}

<insecure code>

{php}

}

{/php}

 

Is there a better way to do that?

 

Likewise, is there a way to capture the current base domain without a similar PHP hack, in Smarty?

 

I have .ca and .net names for my site and I basically want to output a base tag with the proper TLD.

 

I tried poking around in the documentation but it's .. pretty thin unforuntately.

Link to comment
Share on other sites

or you can just set whmcs to serve only secure pages and stop the need to check at the source.

 

also its bad practice to use php in templates, the idea of a template lay out is to seperate the logic from the style. using hooks as suggested might be the best way if you really must perform this check

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated