Fatal error: Call to undefined function site_url() Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!What's the difference between a method and a function?var functionName = function() vs function functionName() startsWith() and endsWith() functions in PHPSet a default parameter value for a JavaScript functionHow do I get PHP errors to display?What is the difference between call and apply?What does the exclamation mark do before the function?“Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHPFatal error: Call to undefined function base_url() in C:wampwwwTest-CIapplicationviewslayout.php on line 5Why shouldn't I use mysql_* functions in PHP?

Are these square matrices always diagonalisable?

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

Trumpet valves, lengths, and pitch

Check if a string is entirely made of the same substring

Passing args from the bash script to the function in the script

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

How to get even lighting when using flash for group photos near wall?

Multiple fireplaces in an apartment building?

Are all CP/M-80 implementations binary compatible?

Could moose/elk survive in the Amazon forest?

Israeli soda type drink

Second order approximation of the loss function (Deep learning book, 7.33)

Suing a Police Officer Instead of the Police Department

Align column where each cell has two decimals with siunitx

Split coins into combinations of different denominations

Why did C use the -> operator instead of reusing the . operator?

How long after the last departure shall the airport stay open for an emergency return?

How to avoid introduction cliches

What was Apollo 13's "Little Jolt" after MECO?

The art of proof summarizing. Are there known rules, or is it a purely common sense matter?

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

How to open locks without disable device?

What is a 'Key' in computer science?

All ASCII characters with a given bit count



Fatal error: Call to undefined function site_url()



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!What's the difference between a method and a function?var functionName = function() vs function functionName() startsWith() and endsWith() functions in PHPSet a default parameter value for a JavaScript functionHow do I get PHP errors to display?What is the difference between call and apply?What does the exclamation mark do before the function?“Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHPFatal error: Call to undefined function base_url() in C:wampwwwTest-CIapplicationviewslayout.php on line 5Why shouldn't I use mysql_* functions in PHP?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








7















I am using the CodeIgniter framework for PHP. I have created a view named "login.php". Once I



created the view, I then loaded the view inside of a function named "index" which is located



inside a class named "CCI" that extends the Controller but I keep receiving this error: Fatal



error: Call to undefined function site_url() in C:wampwwwFinalP_CCI_Clonesystem



applicationviewslogin.php on line 12. I don't understand the issue I an having because the



welcome page loads fine and my second function inside of the "CCI" class loads fine as well.



Here is some of the code:



Controller Files:




function CCI()

parent::Controller();


function index()

$this->load->view('login');


function test()

echo "Testing Data";



}



/* End of file login.php /
/
Location: ./system/application/controllers/cci.php */



class Welcome extends Controller



function Welcome()

parent::Controller();


function index()

$this->load->view('welcome_message');


function test()

echo "Testing Data";





/* End of file welcome.php /
/
Location: ./system/application/controllers/welcome.php */










share|improve this question



















  • 1





    Post more of your code, we can only guess what it could be at this point...

    – Jakub
    Dec 1 '10 at 3:15

















7















I am using the CodeIgniter framework for PHP. I have created a view named "login.php". Once I



created the view, I then loaded the view inside of a function named "index" which is located



inside a class named "CCI" that extends the Controller but I keep receiving this error: Fatal



error: Call to undefined function site_url() in C:wampwwwFinalP_CCI_Clonesystem



applicationviewslogin.php on line 12. I don't understand the issue I an having because the



welcome page loads fine and my second function inside of the "CCI" class loads fine as well.



Here is some of the code:



Controller Files:




function CCI()

parent::Controller();


function index()

$this->load->view('login');


function test()

echo "Testing Data";



}



/* End of file login.php /
/
Location: ./system/application/controllers/cci.php */



class Welcome extends Controller



function Welcome()

parent::Controller();


function index()

$this->load->view('welcome_message');


function test()

echo "Testing Data";





/* End of file welcome.php /
/
Location: ./system/application/controllers/welcome.php */










share|improve this question



















  • 1





    Post more of your code, we can only guess what it could be at this point...

    – Jakub
    Dec 1 '10 at 3:15













7












7








7


2






I am using the CodeIgniter framework for PHP. I have created a view named "login.php". Once I



created the view, I then loaded the view inside of a function named "index" which is located



inside a class named "CCI" that extends the Controller but I keep receiving this error: Fatal



error: Call to undefined function site_url() in C:wampwwwFinalP_CCI_Clonesystem



applicationviewslogin.php on line 12. I don't understand the issue I an having because the



welcome page loads fine and my second function inside of the "CCI" class loads fine as well.



Here is some of the code:



Controller Files:




function CCI()

parent::Controller();


function index()

$this->load->view('login');


function test()

echo "Testing Data";



}



/* End of file login.php /
/
Location: ./system/application/controllers/cci.php */



class Welcome extends Controller



function Welcome()

parent::Controller();


function index()

$this->load->view('welcome_message');


function test()

echo "Testing Data";





/* End of file welcome.php /
/
Location: ./system/application/controllers/welcome.php */










share|improve this question
















I am using the CodeIgniter framework for PHP. I have created a view named "login.php". Once I



created the view, I then loaded the view inside of a function named "index" which is located



inside a class named "CCI" that extends the Controller but I keep receiving this error: Fatal



error: Call to undefined function site_url() in C:wampwwwFinalP_CCI_Clonesystem



applicationviewslogin.php on line 12. I don't understand the issue I an having because the



welcome page loads fine and my second function inside of the "CCI" class loads fine as well.



Here is some of the code:



Controller Files:




function CCI()

parent::Controller();


function index()

$this->load->view('login');


function test()

echo "Testing Data";



}



/* End of file login.php /
/
Location: ./system/application/controllers/cci.php */



class Welcome extends Controller



function Welcome()

parent::Controller();


function index()

$this->load->view('welcome_message');


function test()

echo "Testing Data";





/* End of file welcome.php /
/
Location: ./system/application/controllers/welcome.php */







php function codeigniter view controller






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 1 '10 at 3:41







student

















asked Dec 1 '10 at 2:59









studentstudent

44135




44135







  • 1





    Post more of your code, we can only guess what it could be at this point...

    – Jakub
    Dec 1 '10 at 3:15












  • 1





    Post more of your code, we can only guess what it could be at this point...

    – Jakub
    Dec 1 '10 at 3:15







1




1





Post more of your code, we can only guess what it could be at this point...

– Jakub
Dec 1 '10 at 3:15





Post more of your code, we can only guess what it could be at this point...

– Jakub
Dec 1 '10 at 3:15












2 Answers
2






active

oldest

votes


















34














You have to load the helper. The function site_url() is provided by the url helper, as described here.



$this->load->helper('url');





share|improve this answer























  • Thank You. Your help is really appreciated. Loading the helper function solved the issue.

    – student
    Dec 1 '10 at 3:59






  • 6





    student, you should accept netcoder's answer

    – Thorpe Obazee
    Dec 1 '10 at 11:01


















5














You can try this:




  1. First Load the URL Helper with:




    • $this->load->helper('url'); or set the following value in application/config/autoload.php

    • $autoload['helper'] = array('url');


  2. Then you can show the site url with:


    • base_url() (result: http://example.com/) or


    • site_url() (result: http://example.com/index.php/)


Note: Results depends on values stored in application/config/config.php






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4320820%2ffatal-error-call-to-undefined-function-site-url%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    34














    You have to load the helper. The function site_url() is provided by the url helper, as described here.



    $this->load->helper('url');





    share|improve this answer























    • Thank You. Your help is really appreciated. Loading the helper function solved the issue.

      – student
      Dec 1 '10 at 3:59






    • 6





      student, you should accept netcoder's answer

      – Thorpe Obazee
      Dec 1 '10 at 11:01















    34














    You have to load the helper. The function site_url() is provided by the url helper, as described here.



    $this->load->helper('url');





    share|improve this answer























    • Thank You. Your help is really appreciated. Loading the helper function solved the issue.

      – student
      Dec 1 '10 at 3:59






    • 6





      student, you should accept netcoder's answer

      – Thorpe Obazee
      Dec 1 '10 at 11:01













    34












    34








    34







    You have to load the helper. The function site_url() is provided by the url helper, as described here.



    $this->load->helper('url');





    share|improve this answer













    You have to load the helper. The function site_url() is provided by the url helper, as described here.



    $this->load->helper('url');






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 1 '10 at 3:40









    netcodernetcoder

    54.3k14104132




    54.3k14104132












    • Thank You. Your help is really appreciated. Loading the helper function solved the issue.

      – student
      Dec 1 '10 at 3:59






    • 6





      student, you should accept netcoder's answer

      – Thorpe Obazee
      Dec 1 '10 at 11:01

















    • Thank You. Your help is really appreciated. Loading the helper function solved the issue.

      – student
      Dec 1 '10 at 3:59






    • 6





      student, you should accept netcoder's answer

      – Thorpe Obazee
      Dec 1 '10 at 11:01
















    Thank You. Your help is really appreciated. Loading the helper function solved the issue.

    – student
    Dec 1 '10 at 3:59





    Thank You. Your help is really appreciated. Loading the helper function solved the issue.

    – student
    Dec 1 '10 at 3:59




    6




    6





    student, you should accept netcoder's answer

    – Thorpe Obazee
    Dec 1 '10 at 11:01





    student, you should accept netcoder's answer

    – Thorpe Obazee
    Dec 1 '10 at 11:01













    5














    You can try this:




    1. First Load the URL Helper with:




      • $this->load->helper('url'); or set the following value in application/config/autoload.php

      • $autoload['helper'] = array('url');


    2. Then you can show the site url with:


      • base_url() (result: http://example.com/) or


      • site_url() (result: http://example.com/index.php/)


    Note: Results depends on values stored in application/config/config.php






    share|improve this answer





























      5














      You can try this:




      1. First Load the URL Helper with:




        • $this->load->helper('url'); or set the following value in application/config/autoload.php

        • $autoload['helper'] = array('url');


      2. Then you can show the site url with:


        • base_url() (result: http://example.com/) or


        • site_url() (result: http://example.com/index.php/)


      Note: Results depends on values stored in application/config/config.php






      share|improve this answer



























        5












        5








        5







        You can try this:




        1. First Load the URL Helper with:




          • $this->load->helper('url'); or set the following value in application/config/autoload.php

          • $autoload['helper'] = array('url');


        2. Then you can show the site url with:


          • base_url() (result: http://example.com/) or


          • site_url() (result: http://example.com/index.php/)


        Note: Results depends on values stored in application/config/config.php






        share|improve this answer















        You can try this:




        1. First Load the URL Helper with:




          • $this->load->helper('url'); or set the following value in application/config/autoload.php

          • $autoload['helper'] = array('url');


        2. Then you can show the site url with:


          • base_url() (result: http://example.com/) or


          • site_url() (result: http://example.com/index.php/)


        Note: Results depends on values stored in application/config/config.php







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 23 '18 at 17:35









        fullstackpanda

        32




        32










        answered May 8 '15 at 2:56









        DharmanaDharmana

        791210




        791210



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4320820%2ffatal-error-call-to-undefined-function-site-url%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved