eldan88 Posted August 4, 2014 Share Posted August 4, 2014 Hey Guys. I am using php to output to frames. When I add an "\n" tag of even a PHP_EOL the second frame shows blank. The weird thing is when I view the page source I can clearly see the HTML of both frames... Can anyone help me resolve this issue? Thanks! $iframe = "<iframe src='menu_new.php' width='65%' name='menu' id='menu' title='Menu Frame' ></iframe>\n"; //iframe not working when adding the /n on this line $iframe .= "<iframe src='menu-items.php' width='35%' name='menu-items' id='menu-items' scrolling='yes' noresize='noresize' title='Menu Items Frame'></iframe>\n"; echo $iframe; Quote Link to comment https://forums.phpfreaks.com/topic/290259-why-is-the-frame-not-displaying-when-using-n-tag/ Share on other sites More sharing options...
CroNiX Posted August 4, 2014 Share Posted August 4, 2014 Not sure as I copy/pasted your code and it ran fine with the exception of not locating the menu_new.php and menu-items.php files (why does one use a underscore and the other a dash?). Anything in the logs? But... why even use php there? All you're doing is creating HTML and echoing it out. Why do you care about formatting the source code with \n? Quote Link to comment https://forums.phpfreaks.com/topic/290259-why-is-the-frame-not-displaying-when-using-n-tag/#findComment-1486774 Share on other sites More sharing options...
cyberRobot Posted August 4, 2014 Share Posted August 4, 2014 The code works for me also (with and without the newline character). In case it matters, I even created a test page for both menu_new.php and menu-items.php. Did you try running the HTML code through a validator? http://validator.w3.org/ Perhaps something else is going on... Quote Link to comment https://forums.phpfreaks.com/topic/290259-why-is-the-frame-not-displaying-when-using-n-tag/#findComment-1486789 Share on other sites More sharing options...
Zane Posted August 5, 2014 Share Posted August 5, 2014 No idea what's wrong. It must be on your end. Put a carriage return \r in there, maybe that'll fix it? $iframe = "<iframe src='menu_new.php' width='65%' name='menu' id='menu' title='Menu Frame' ></iframe>\r\n"; Are you sure that this happens exclusively when you put the newline character? Quote Link to comment https://forums.phpfreaks.com/topic/290259-why-is-the-frame-not-displaying-when-using-n-tag/#findComment-1486822 Share on other sites More sharing options...
Solution eldan88 Posted August 5, 2014 Author Solution Share Posted August 5, 2014 Hey cyberRobot and Zane. I realized it was a problem with the width on the left frame. I took down 1% and it shows on the right frame now. From some reason when I added the "/n" it didn't fit in the right frame, until I changed with wdith to 34% from 35% Quote Link to comment https://forums.phpfreaks.com/topic/290259-why-is-the-frame-not-displaying-when-using-n-tag/#findComment-1486870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.