hbuchel Posted August 19, 2009 Share Posted August 19, 2009 I have a wordpress blog that contains a custom field where the user enters the ID of a youtube video. Then using PHP, I insert that ID into the code to embed the video on the page. It works nicely because I can also use the ID to pull a thumbnail from Youtube for the archives page. The problem is, the videos don't show up in Internet Explorer; every other browser appears to work fine. This is what my code looks like to display the video: <?php $youtubeid = get_post_meta($post->ID, "youtubeid", true); ?> <?php if($youtubeid !== '') { ?> <div class="video_style"> <object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/<?php echo $youtubeid; ?>"> <param name="movie" value="http://www.youtube.com/v/<?php echo "youtubeid"; ?>" /> </object> </div> <?php } ?> Does internet explorer just not like you inserting php into the embedding code? Quote Link to comment https://forums.phpfreaks.com/topic/171065-solved-php-and-youtube-embed-code/ Share on other sites More sharing options...
nomis Posted August 20, 2009 Share Posted August 20, 2009 your problem may exist in different part of your code... in my experience, the only thing that stops IE is some bad HTML syntax (e.g. an unclosed HTML tag). Quote Link to comment https://forums.phpfreaks.com/topic/171065-solved-php-and-youtube-embed-code/#findComment-902220 Share on other sites More sharing options...
hbuchel Posted August 20, 2009 Author Share Posted August 20, 2009 I actually feel quite foolish. Upon looking at the source again from the browser I noticed something was wrong with the embed code I was using. Went to youtube and switched it out for another and was able to get it to work in internet explorer. Quote Link to comment https://forums.phpfreaks.com/topic/171065-solved-php-and-youtube-embed-code/#findComment-902223 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.