TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-08-2010, 06:10 PM   #1 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default Embed Youtube code in .htm

Ok so im working on this site... it all works well i have the add youtube script etc...

It uses highslide to view the video on site so the file where the youtube video inbeds i am using is .htm

So i have made a script that allows the website owner to add his videos using a simple layout and it creates a .htm file in the spcified location using the episode number and .htm extension

Anyway i have a text field form where he inserts the Episode name number and the youtube embed code and it all adds but i run in to an issue and now i am clueless

Youtube embed code:
HTML Code:
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/nvNuc9isOeU&amp;hl=en_GB&amp;fs=1?color1=0x234900&amp;color2=0x4e9e00"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nvNuc9isOeU&amp;hl=en_GB&amp;fs=1?color1=0x234900&amp;color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
so we have the embed code and submit is pushed which takes us to the add script

PHP Code:
$epnumb $_REQUEST["epnum"];
$epembedcode $_REQUEST["epcode"];
//lets right to the new .htm file start off fresh to save confusion
$myFile '../../highslide/eps/ep' $epnumb '.htm';
$fh fopen($myFile'a') or die("can't open file");
$stringData '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Included content</title>
    <style type="text/css">
        p {
            font-family: "Trebuchet MS", Arial, sans-serif;
            font-size: 10pt;
        }
        h3 {
            font-family: "Trebuchet MS", Arial, sans-serif;
            color: #666;
        }
    </style>
</head><body style="margin:0;padding:0">
<p>' 
$epembedcode '</p>
</body>
</html>'

Now this does what its meant to do it creates the new file on server and writes to it, however the youtube embed code comes out like this in the actualy htm file

HTML Code:
<p><object width=\"480\" height=\"385\"><param name=\"movie\" value=\"http://www.youtube.com/v/nvNuc9isOeU&amp;hl=en_GB&amp;fs=1?color1=0x234900&amp;color2=0x4e9e00\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/nvNuc9isOeU&amp;hl=en_GB&amp;fs=1?color1=0x234900&amp;color2=0x4e9e00\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"385\"></embed></object></p>
adding backslashes and bla bla bla and now im lost... why does this do such and thing and how would i fix it?

Thanks
Tim Dobson is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prettifying Pasted Code on TalkPHP Wildhoney The Lounge 15 01-04-2013 02:46 AM
Tips to Improve Your Coding and Projects Village Idiot Tips & Tricks 45 12-03-2012 07:46 AM
Writing Clean Code Village Idiot Tips & Tricks 10 06-25-2012 12:35 PM
Match code in link with code with one in file and extract line Peuplarchie General 0 10-23-2009 02:38 PM
Game: Let's Develop Something Crazy! Wildhoney The Lounge 25 05-23-2009 09:18 PM


All times are GMT. The time now is 07:03 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design