Questions about CI + SSL |
[eluser]DeaD SouL[/eluser]
Hello coders ![]() I use Code: anchor() 1) Is there any similar function to generate https links? Or I should create my own? 2) How can I use SSL for certain controllers ? This is my first time to use SSL, So, please don't skimp about any security tips or anything else. Please help me out.. I'm stuck in this ![]() Thanks a lot in advance ![]()
[eluser]Phil Sturgeon[/eluser]
This is the best solution I have come accross, using routes to define secure pages. Other solutions exist (in their hundreds) on Google.
[eluser]richfearless[/eluser]
This is not my own solution, but i find this quite helpful if you have used <?=base_url()?> to get the location for href's: Code: $config['base_url'] = (isset($_SERVER['HTTPS']) ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . '/site/'; Again, this is not my own solution.
[eluser]DeaD SouL[/eluser]
Thanks richfearless, Actually, I made this function Code: function anchor_ssl($segments='', $text=NULL, $attributes='') it did the job, but it keeps calling str_replace() with each time anchor_ssl() is being called so, i created ssl_url_helper.php, based on url_helper.php Code: if ( ! function_exists('site_url_ssl')) and added this in config.php Code: $config['base_url'] = "http://domain.ext/folder"; so, instead of using anchor('url', 'title', 'attributes'), i use anchor_ssl('url', 'title', 'attributes') to generate the https links |
Welcome Guest, Not a member yet? Register Sign In |