Welcome Guest, Not a member yet? Register   Sign In
Adding standalone blog
#2

(06-07-2015, 05:04 PM)keld Wrote: Hi guys, I have this site built with CI.
Standard folder structure. css, img, js folders outside the application folder.
I'm replacing one of the page with a standalone simple blog (http://simpleblogphp.com/).
The folder contains hundreds of files. Right now this folder sits outside the application folder, next to the css and img folders.
I created a blog view and controller. Now when I navigate to the blog page I get errors.
To make this blog display within my site and based on the blog's documentation I'm adding this in my blog view:


PHP Code:
<?php include(base_url()."/blogger/blog.php"); ?>

Resulting in:



Code:
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message:  include() [<a href='function.include'>function.include</a>]: http:// wrapper is disabled in the server configuration by allow_url_include=0</p>
<p>Filename: views/blog.php</p>
<p>Line Number: 3</p>
</div>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message:  include(http://dev.mysite.com/20150607-Adding-blog/blogger/blog.php) [<a href='function.include'>function.include</a>]: failed to open stream: no suitable wrapper could be found</p>
<p>Filename: views/blog.php</p>
<p>Line Number: 3</p>
</div>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message:  include() [<a href='function.include'>function.include</a>]: Failed opening 'http://dev.mysite.com/20150607-Adding-blog/blogger/blog.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')</p>
<p>Filename: views/blog.php</p>
<p>Line Number: 3</p>

Where else can I put that blog folder so it would display correctly?

Thank you in advance.

base_url() will get you an url. your PHP config prevents you from including files from an url. you should keep it that way in order to prevent RFI attacks. if you really need to include() something on CI, you should use CI constants. FCPATH instead of base_url() should get you what you want. but you might want to use a redirect instead.
Reply


Messages In This Thread
Adding standalone blog - by keld - 06-07-2015, 05:04 PM
RE: Adding standalone blog - by josetrindade - 06-08-2015, 05:18 AM
RE: Adding standalone blog - by keld - 06-10-2015, 02:09 PM
RE: Adding standalone blog - by mwhitney - 06-11-2015, 12:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB