Jump to content

Problem embedding Youtube-video


granitport

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/274864-problem-embedding-youtube-video/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.