Sangha-08 Posted April 21, 2008 Share Posted April 21, 2008 Hi, I am relatively new to "php" , and i was just wondering if someone could help me make a script . Here's what i want to do : I want to make 1 dynamic page called embed.php , i want it to embed every .flv video given to it ( for example : http://www.mydomain/embed.php?file=http://www.mydomain22.com/somerandomvideo.flv ) i want the page thats loaded to look something like this : <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="600" height="450" id="flvplayer" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="Get this part from the URL" /> <param name="loop" value="true" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <embed src="Get this part from the URL" loop="true" quality="high" bgcolor="#000000" width="600" height="450" name="flvplayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed> Please note : I'm 13 , have a good knowledge of html , dhtml , and run a anime video website. Please dont be harsh , and correct me when im wrong. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/ Share on other sites More sharing options...
947740 Posted April 21, 2008 Share Posted April 21, 2008 Use a $file = $_GET['file']; to retrieve the location of the file and just echo that in the place of the video src. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522891 Share on other sites More sharing options...
jonsjava Posted April 21, 2008 Share Posted April 21, 2008 more to the point, if you want to use a DB: DB code--modify for your needs CREATE TABLE `DB_NAME`.`table_movies` ( `id` INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `movie_name` VARCHAR( 50 ) NOT NULL , `movie_url` VARCHAR( 80 ) NOT NULL , `movie_short_desc` VARCHAR( 250 ) NOT NULL , `movie_long_desc` VARCHAR( 500 ) NOT NULL , INDEX ( `movie_name` ) , UNIQUE ( `movie_url` ) )ENGINE=MYISAM PHP CODE Modify to your needs, adding the database connection info <?php $id = addslashes($_GET['id']); $sql = "SELECT * FROM `table_movies` WHERE id='{$id}';"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $url = $row['movie_url']; $output = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='600' height='450' id='flvplayer' align='middle'> <param name='allowScriptAccess' value='sameDomain' /> <param name='allowFullScreen' value='true' /> <param name='movie' value='{$url}' /> <param name='loop' value='true' /> <param name='quality' value='high' /> <param name='bgcolor' value='#000000' /> <embed src='{$url}' loop='true' quality='high' bgcolor='#000000' width='600' height='450' name='flvplayer' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>"; print $output; ?> Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522899 Share on other sites More sharing options...
Sangha-08 Posted April 21, 2008 Author Share Posted April 21, 2008 Whoa ! Thats a really quick reply ! Thanks ! I did not use jonsjava's code because it was too complicated and needed "mysql" ( i don't know anything about mysql ). I decided to use 947740's code instead , but it dose not seem to work. have i done anything wrong ? <html> <head> </head> <body> <embed src="http://www.jeroenwijering.com/embed/player.swf" width="320" height="250" allowscriptaccess="always" allowfullscreen="true" flashvars="file=<?PHP $file = $_GET['file']?>"/> </body> </html> I renamed the page's extenction to .php rather than .html , but it still dose not work ? can someone help me out ? Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522920 Share on other sites More sharing options...
jonsjava Posted April 21, 2008 Share Posted April 21, 2008 the next step is going to(example) http://www.mydomain/embed.php?file=http://www.mydomain22.com/somerandomvideo.flv Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522936 Share on other sites More sharing options...
jonsjava Posted April 21, 2008 Share Posted April 21, 2008 or, easier: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="600" height="450" id="flvplayer" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="<?php print $_GET['file']; ?>" /> <param name="loop" value="true" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <embed src="<?php print $_GET['file']; ?>" loop="true" quality="high" bgcolor="#000000" width="600" height="450" name="flvplayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed> now, go to http://yourdomain.com/this_files_name.php?file=http://urltovideo.com/video.flv (example) Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522943 Share on other sites More sharing options...
cooldude832 Posted April 21, 2008 Share Posted April 21, 2008 php applications designed to create "files" shouldn't be html files you should have it distribute a pure .flv file in the php file via proper header modifications and so forth. Then integrate that into an html file if needed. When you add too much to a single function you limit the functionability to it later on. Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522948 Share on other sites More sharing options...
jonsjava Posted April 21, 2008 Share Posted April 21, 2008 Maybe we should let him test his hand at easier stuff first, huh? Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522950 Share on other sites More sharing options...
947740 Posted April 22, 2008 Share Posted April 22, 2008 jonsjava already said this, but you have to echo, or print the url in the code. All you did was define the variable. jonsjava also provided the code. The next thing you have to do is go to your page with a video url in the url. It should work. Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-523929 Share on other sites More sharing options...
Sangha-08 Posted April 22, 2008 Author Share Posted April 22, 2008 Yes !!! I've finally done it. I even added a "title" variable so that now i can define the location of the .flv file and i can also define the title tag ! thanks for helping me, This is the best forum ever ! Quote Link to comment https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-524106 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.