include() ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: include() ? (/showthread.php?tid=15719) |
include() ? - El Forum - 02-12-2009 [eluser]trevor2[/eluser] I'm new to CI, php and programming in general. How do I properly include other php files, such as a functions.php? Or are they supposed to be placed in the model thing? My config file has : $config['base_url'] = "http://localhost/"; The include file I would normally call by this: <?php include("functions_test.php"); ?> I also tried: <?php include(base_url("functions_test.php")); ?> Which gives these errors: ******************************************************************** A PHP Error was encountered Severity: Warning Message: include() [function.include]: URL file-access is disabled in the server configuration Filename: views/blogview.php Line Number: 7 A PHP Error was encountered Severity: Warning Message: include(http://localhost/) [function.include]: failed to open stream: no suitable wrapper could be found Filename: views/blogview.php Line Number: 7 A PHP Error was encountered Severity: Warning Message: include() [function.include]: Failed opening 'http://localhost/' for inclusion (include_path='.;C:\xampp\php\pear\') Filename: views/blogview.php Line Number: 7 ********************************************************************************** include() ? - El Forum - 02-12-2009 [eluser]johnwbaxter[/eluser] You can turn them into libraries or helpers if you like. Then load them like err.. libraries or helpers http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html |