Welcome Guest, Not a member yet? Register   Sign In
base_url() not being parsed (from HTML stored in SQL database)


I've found the real problem to be the fact that I'm echo'ing HTML containing PHP in my view like so:

<?php echo $content; ?>

Where content contains more PHP code. Is there any way to recursively parse echo'ed PHP?


Hello everyone,

I'm rather new to CodeIgniter & decided to try & convert my girlfriend's website into a CodeIgniter application.

The idea idea is to have a MySQL database containing a "PageContent" table (w/3 rows: id, name, data). Before & after inserting data into the table, I'm using PHP's add/removeslashes functions to ensure the quotations won't cause an issue.

I've got a single controller, named Page, who's index takes a single parameter--page name. From here, it passes this name to the model & pulls the appropriate page from the DB.

The problem is that the code pulled from the DB (which contains PHP for base_url()) is not getting parsed, and I end up with something like this in the page source:

<img src="&lt;?=base_url()?&gt;images/head_shot2.jpg" class="image1" alt="Head Shot Photo" />

Any ideas would be greatly appreciated.


Messages In This Thread
base_url() not being parsed (from HTML stored in SQL database) - by El Forum - 09-01-2010, 10:21 PM

Theme © iAndrew 2016 - Forum software by © MyBB