Welcome Guest, Not a member yet? Register   Sign In
Localhost url not working in iframe
#1

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="http://www.w3schools.com" class="form-control" allowfullscreen="true" ></iframe


But just not localhost how can I display that with a localhost url?
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

(This post was last modified: 01-08-2016, 06:16 AM by InsiteFX.)

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB