[SOLVED] Getting parent url codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [SOLVED] Getting parent url codeigniter (/showthread.php?tid=60878) |
[SOLVED] Getting parent url codeigniter - El Forum - 07-17-2014 [eluser]riwakawd[/eluser] On my codeigniter project I have sub folder called admin so url would be http://localhost/project/admin/ On the admin index.php I have a function which allows me to define url path so do not have to enter it in config.php so all I would have to enter in base url is $config['base_url] = BASE_SERVER; which returns http://localhost/project/admin/ Problem But also I same function renamed that should get the parent url but does not. Still gets the current url. Question How do I change the $catalog_url to get parent url http://localhost/project/ On my admin index.php Code: <?php config.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); [SOLVED] Getting parent url codeigniter - El Forum - 07-18-2014 [eluser]riwakawd[/eluser] After thinking about it for a while I had to do this working great now. Code: if (isset($_SERVER['HTTP_HOST'])) { |