514x0r Posted August 27, 2010 Share Posted August 27, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/211874-simple-task-but-stuck/ Share on other sites More sharing options...
Adam Posted August 27, 2010 Share Posted August 27, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/211874-simple-task-but-stuck/#findComment-1104349 Share on other sites More sharing options...
litebearer Posted August 27, 2010 Share Posted August 27, 2010 Might consider having him simply FTP the txt file - no form necessary Quote Link to comment https://forums.phpfreaks.com/topic/211874-simple-task-but-stuck/#findComment-1104352 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.