granitport Posted February 23, 2013 Share Posted February 23, 2013 (edited) Hello! I'm kind of a beginner so please excuse any stupidity of mine. I'm working on a mini project and I want to make it easy to embed youtube videos on this website. The problem is that the embedding doesn't work when using my script. I'm not completely sure it's a PHP-problem so please move the thread if needed. <p> <iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="[PAGE_URL]" frameborder="0" allowFullScreen> </iframe> <br> <a href="[PAGE_URL]">[PAGE_TITLE]</a><br/> [PAGE_DESCRIPTION]<br/> [PAGE_URL] </p> I've created a form to use for myself as admin to make it easy embedding videos and above is the result on the public page. The problem is that [PAGE_URL] doesn't work in the iframe to retrieve the URL for the video. The result is just a white box in the browser. I know that [PAGE_URL] works because the link prints as it should below outside of the iframe. I also know the embedding works in general because it works fine if I just put the URL in myself. Any ideas? Maybe this shouldn't even work. If not, any ideas of what I can do instead to make it smooth for me to upload embedded videos to my website? Thanks Edited February 23, 2013 by granitport Quote Link to comment https://forums.phpfreaks.com/topic/274864-problem-embedding-youtube-video/ Share on other sites More sharing options...
Jacbey Posted February 23, 2013 Share Posted February 23, 2013 Hows about you just go onto youtube and copy the embed code it provides?? Quote Link to comment https://forums.phpfreaks.com/topic/274864-problem-embedding-youtube-video/#findComment-1414495 Share on other sites More sharing options...
granitport Posted February 23, 2013 Author Share Posted February 23, 2013 I could, yes. But I'm going to post a lot of videos so that's why I would prefer not to edit my code every single time I want to add a video. That's why I want to use a form as an admin to make it quick and simple. Quote Link to comment https://forums.phpfreaks.com/topic/274864-problem-embedding-youtube-video/#findComment-1414504 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.