I'm still a php beginner...I searched for someone with a coding issue like mine but could not find specifically what I was looking for. I apologize if somehow I missed an identical post somewhere.
I have a php generated list of top 10 videos (listed by titles). The list (which is correctly ordered and is generated from a foreach loop) of titles is anchored per title to a sample video in a specific location of the html portion of the page, specifically in an iframe. When the user clicks on the titles of the videos, the sample YouTube video plays in the correct location with no problem, even when the iframe has a 'name' assigned to it. However, as soon as the 'target' attribute (bolded below) is added to the php code, referencing the 'name' of the iframe, the correct video loads for about 1 second, and then disappears, leaving in its place a portion of the home page of my site (iframe dimensions are much smaller than whole page). Here is the code:
<html>
<div id="iframe_play"> <!--Start iframe-->
<iframe name="iframe1" width="558" height="325"
src="http://www.youtube.com/embed/MAFzWFHmXiw" frameborder="0"></iframe>
</div>
.
. //Some code
.
<td class="class1"><?php
echo "<ol style=\"list-style:none; margin: 0; padding: 0\">";
$i = 1;
foreach ($videos as $video) {
if($i>10){
break; //Necessary to terminate loop properly
}
echo "<li style=\"margin-left:20px\"><font size=2
style=\"color:red\">".$i."</font>"."  <a href=\"#null\"
**target=\"iframe1"** onclick=\"activatevideo();\"><font size=2
style=\"color:#23B223\">".substr($video['title'],0,23)."</font></a></li>";
$i++;
}
echo "</ol>";
?></td>
</html>
I should add that it would be gravy to 'target' selected sections of the page, but if for some reason I cannot accomplish this I will live with omitting the target=\"iframe1". Can someone please explain this disappearing sample video within the iframe only when using 'target'?