Jump to content

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.