• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Localhost url not working in iframe

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!

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 )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.