|
-
Jul 23rd, 2010, 10:28 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Loop & Code exiting after echoing iframe
Here is my code:
Code:
<?php
if($fileContents == "New Page"){
echo "Please select a layout for this new page.<br />";
if ($handle = opendir('layouts')) {
$count = 0;
while (false !== ($file = readdir($handle))) {
if ($file != "thumbnails" && $file != "." && $file != "..") {
echo "<iframe src='layouts/$file' style='width:200px;height:200px;' />";
$count++;
}
}
closedir($handle);
}
echo "<br />Count: $count";
}
?>
The Problem
After the first Iframe is echoed, the PHP exits, just as if I were to use exit();. If I replace echo "<iframe...." with echo $file, it displays three files - which means there should be three Iframes when using the Iframe echo statement. Why is the Iframe exiting my PHP code?
-
Jul 23rd, 2010, 10:39 AM
#2
Re: Loop & Code exiting after echoing iframe
it is outputting all the iframes -- you're just not closing them.
iframes won't let you close them without an explicit closing tag.
-
Jul 23rd, 2010, 11:56 AM
#3
Thread Starter
Frenzied Member
Re: Loop & Code exiting after echoing iframe
 Originally Posted by kows
it is outputting all the iframes -- you're just not closing them.
iframes won't let you close them without an explicit closing tag.
Oh, I never thought there was a need for the closing tag.. I thought I could write it the same way I write <br /><hr /><img /> etc...
Thanks, it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|