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&hl=en_GB&fs=1?color1=0x234900&color2=0x4e9e00"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nvNuc9isOeU&hl=en_GB&fs=1?color1=0x234900&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&hl=en_GB&fs=1?color1=0x234900&color2=0x4e9e00\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/nvNuc9isOeU&hl=en_GB&fs=1?color1=0x234900&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