CodeIgniter Forums

Full Version: Localhost url not working in iframe
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a question on local host url in iframe.

I does not seem to pick the url up

PHP Code:
<iframe id="question-iframe" width="800" height="800"  src="<?php echo base_url();?>" class="form-control" allowfullscreen="true" ></iframe

It works fine with

PHP Code:
<iframe id="question-iframe" width="800" height="800"  src="" class="form-control" allowfullscreen="true" ></iframe

But just not localhost how can I display that with a localhost url?
If your on a Windows system check your IE Options, there is a setting to allow for iframes in there.

DIRECTORY_SEPARATOR equals to "/" (Unix) or "\" (Windows), and this is where the problem lies,
you cannot change this constant from ‘/’ to ‘\’ .

if (!defined('DS'))
define('DS', '/');

So if your on Windows try using a \ Creating your own base_url helper.