Jump to content

Simple task but stuck


514x0r

Recommended Posts

I have a client that has a youtube video on his page that he changes everyday.

 

I have been wrestling with being able to allow him to login to an admin page, that returns a simple form for him to input the new video id from his youtube link which then posts to a txt file. This text file is then included in the html for to supply the correct youtube video.

 

Basically the way it is now the html page has

 

<iframe class="youtube-player" type="text/html" width="566" height="266" src="http://www.youtube.com/embed/Video Id Here" frameborder="0">
</iframe>

 

Now I have been completely unsuccessful just creating a form that will let him change just the "Video Id" so we have been working on copying and pasting the entire iframe code in the form.

 

My first attempt created backslashes in the txt file where quotes are, I then added stripslashes to fwrite and that posted nothing to my txt file.

 

So I'm not sure if the code I have is worth a spit or if I should restart with some assistance.

 

My main goal (if achievable) is to remove the iframe code from the html page and use a php include to include the text file that has the iframe in it. Then create a page for my client to login to to paste either the video url or just the video id and have this change on the fly.

 

Any help would greatly be appreciated!

Link to comment
Share on other sites

Why'd entering the ID fail?

 

<iframe class="youtube-player" type="text/html" width="566" height="266" src="http://www.youtube.com/embed/<?php echo file_get_contents('/path/to/file.txt'); ?>" frameborder="0">
</iframe>

 

 

Link to comment
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.