• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
url_helper error/bug

Hi everyone,

I am trying to use current_url() function on my localhost but getting this error below;

PHP Code:
Call to a member function uri_string() on null in /opt/lampp/htdocs/ci_3/system/helpers/url_helper.php on line 106 

I loaded the url helper with in config/autoload.php. segment() function also getting the same error. My php version is 5.6.12, so is that the reason of the problem? How can i fix this error?

Here is my controller and view files.

PHP Code:
class Home extends CI_Controller {


    public function 
$data['title'] = 'Test';

PHP Code:
<!DOCTYPE html>
html lang="en">
meta charset="UTF-8">
title><?php echo $title?></title>
    <h2>Hello World!</h2>
    <p><?php echo current_url(); ?></p>

We don't need the same threads posted twice ... http://forum.codeigniter.com/thread-63047.html
It won't help you, but will just confuse others.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.