PHP - Creating The Embed Code For Video
hey guys,
what i have done so far is got the link to a bbc video feed so when you go to my site the php code will retrive the latest video from bbc and get the link. so i now have $url as having the value of the video but i now need to insert it into the html embed video code. so how can i make this. Code: [Select] <object width="416" height="374" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="ep"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /><param name="movie" value="http://i.cdn.turner.com/cnn/.element/apps/cvp/3.0/swf/cnn_416x234_embed.swf?context=embed_edition&videoId=world/2009/06/28/penhaul.lok.honduras.cnn" /><param name="bgcolor" value="#000000" /><embed src="http://i.cdn.turner.com/cnn/.element/apps/cvp/3.0/swf/cnn_416x234_embed.swf?context=embed_edition&videoId=world/2009/06/28/penhaul.lok.honduras.cnn" type="application/x-shockwave-flash" bgcolor="#000000" allowfullscreen="true" allowscriptaccess="always" width="416" wmode="transparent" height="374"></embed></object> Similar TutorialsI am looking for a code where I can get a video URL from Youtube, Vimeo, Facebook and convert it to an embedded video to be shown on my site. I found a script that does that. It works fine. The only errors I get are in the inspect element window in the browser. Errors such as this. Failed to load resource: net::ERR_BLOCKED_BY_CLIENT googleads.g.doubleclick.net/pagead/id:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT static.doubleclick.net/instream/ad_status.js:1
This is the function to generate the embedded videos. Do the above errors matter if the videos show up and play fine? function generateVideoEmbedUrl($url){ //This is a general function for generating an embed link of an FB/Vimeo/Youtube Video. $finalUrl = ''; if(strpos($url, 'facebook.com/') !== false) { //it is FB video $finalUrl.='https://www.facebook.com/plugins/video.php?href='.rawurlencode($url).'&show_text=1&width=200'; }else if(strpos($url, 'vimeo.com/') !== false) { //it is Vimeo video $videoId = explode("vimeo.com/",$url)[1]; if(strpos($videoId, '&') !== false){ $videoId = explode("&",$videoId)[0]; } $finalUrl.='https://player.vimeo.com/video/'.$videoId; }else if(strpos($url, 'youtube.com/') !== false) { //it is Youtube video $videoId = explode("v=",$url)[1]; if(strpos($videoId, '&') !== false){ $videoId = explode("&",$videoId)[0]; } $finalUrl.='https://www.youtube.com/embed/'.$videoId; }else if(strpos($url, 'youtu.be/') !== false){ //it is Youtube video $videoId = explode("youtu.be/",$url)[1]; if(strpos($videoId, '&') !== false){ $videoId = explode("&",$videoId)[0]; } $finalUrl.='https://www.youtube.com/embed/'.$videoId; }else{ //Enter valid video URL } return $finalUrl; }
Hi guys, In an application I'm working on, I'm looking to embed a youtube video with [YOUTUBE][/YOUTUBE]. Code: [Select] echo preg_replace('#(?:<\>]+href=\")?(?:http://)?((?:[a-zA-Z]{1,4}\.)?youtube.com/(?:watch)?\?v=(.{11}?))[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#', '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$matches[2].'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$matches[2].'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>', $ENTIREPAGE?); The problem is that the video appears with a slider control at the bottom. How do I get rid of the Youtube slider control at the bottom? Thanks. This is a section of my code that goes and gets videos from any video site. What I’m having issues with is having it post a random title, that are all in a text file called titles.txt. What I’m wanting to accomplish is have my script go pull the video embed code, the duration, the tags, etc. Which all works fine until I get to the title part where it pulls locally from the server from the text file. I'm not an advance programmer so not sure if I am even approaching this correct way. Here is the code I have that is responsible for putting the title in. I appreciate your help. $video = array( ‘user_id’ => $this->user_id, ‘status’ => $this->status, ‘site’ => ‘my site’, ‘id’ => ‘’, ‘embeddable’ => true, ‘url’ => ‘’, ‘titles’ => ‘’, ‘title’ => ‘’, ‘description’ => ‘’, ‘tags’ => ‘’, ‘category’ => ‘’, ‘thumbs’ => array(), ‘duration’ => 0, ‘embed’ => ‘’ ); function random_title () { $titles = file (“titles.txt”, FILE_IGNORE_NEW_LINES); $num = rand (0, intval (count ($titles) / 3)) * 3; return ucwords($titles[$num]); } //Title if(preg_match(’/title="(.*?)"/’, $match, $matches_title)) { $video[‘title’] = random_title(). ’ - My site name’; } else { $this->errors[] = ‘Failed to get video title for ‘.$video[‘url’].’!’; if (!$this->debug) continue; else $debug_e[] = ‘TITLE’; }
Hello,
How can I make gif from video while uploading it or after uploaded? Is there any tutorial.. I've been searched but didn't found anything.
The reason I want this is because when I upload video then I will show few thumbnails of the video on the page. Then when user hover the video will play short gif from the video 2-5 seconds and when the user click on video will play the video.. Hope you get what I mean.. I don't know how to explain it better. Just point me somewhere to read or watch about this..
Thank's in advanced!
p.s. Sorry for my English!
EDIT:
Here is the exaplme.. when you hover over the video an hold your mouse there it will play some gif
http://gifsoup.com/faq.php
Is it possible this?
Edited by vinsb, 10 September 2014 - 07:49 AM. Hi. I am trying to create a simple video file server. I finished the skeleton of it but when it came to creating the multitude of pages I realized that there could be an easier way to do it.
I started out basically getting the folder names in the server then printing them on the page.
<?php $dirs = glob("*", GLOB_ONLYDIR); echo '<ul>'; foreach($dirs as $dir) { $forbidden_folders = array("not4u", "ignore", Styles); $filename = str_replace($forbidden_folders, '', $dir); if (!empty($filename)) { echo '<li><a href="'.$dir.'">'.$dir.'</a></li>'; } } echo '</ul>' ?>Then I created in each of the folders with files a php file with this code: <?php function date_sort_desc($a, $b) { preg_match('/\w+ \d{4}/', $a, $matches_a); preg_match('/\w+ \d{4}/', $b, $matches_b); $timestamp_a = strtotime($matches_a[0]); $timestamp_b = strtotime($matches_b[0]); if ($timestamp_a == $timestamp_b) return 0; return $timestamp_a < $timestamp_b; } $files = array(); $dir = opendir('.'); while(false != ($file = readdir($dir))) { if(($file != ".") and ($file != "..") and ($file != "index.php")) { $files[] = $file; } } natsort($files); $i = 0; foreach($files as $file) { $i++; $string = str_replace("TV Show Name S1 E$i - ", '' , $file); echo '<div><a href="../Discriptions/'.$file.'.php">'.basename($string, '.m4v').'</a></div><br>'; } ?>This opens up a php file with the same file name as the file to be played containing the episode's thumbnail and description. That file then contains a link pointing back to the real file. The problem here is that I'd have to make a new php file for every file in my collection. I'm wondering if there's somehow a way to simplify all of this. Edited by chrisyroid, 11 August 2014 - 12:13 AM. I tried searching google and phpclasses.org for something of this nature, but can't seem to come across anything. (or possibly using the wrong keywords). Basically I am looking for a class that I can instantiate with a URL (or similar), and in turn it will provide me with the appropriate embed code for that video along with a thumbnail. (Thumbnail optional) I currently having something im using, but its restricted purely to YouTube, and wish to expand it to all video providers. Does anyone know of any code available (class) that can provide me with what I mentioned above. Thanks Ok I have a unique issue I have a decent sized database for a fix up and modify project I just landed. My problem is my client has a table with plain html, flash, javascript it in. Which generally speaking isn't to much a problem if I we're going the straight php route to get the data from the database. However I'm not so lucky. These people wish to have the element being built by me to use AJAX to give the site a "2.0" feel, which again to a point fine. So all this said and done, I am going using jQuery as my frame for the javascript. The landing page for the script is PHP it handles any potential user input checks before it works its way into the javascript variables to then use JSON through the javascript to another php file which in turn double checks the inputs just incase someone wants to go in to the source find the way to the file its gathering the data from an all else. Then based on the data forms its output. Which I don't know why Ive wasted my time explaining that, we all know how JSON works in concept at least. My issue with this all is, a single column or 2 but ill stick with just the one for now... with these people having stored plain html, javascript, and object tags for flash in the column without any htmlspecialchars or stripslash's or really any security per say in mind. In other words I can go into any column and just copy and paste the code and have it work in an HTML file as if it were typed out for use in HTML alone. So with that, my JSON requests are failing due to the extra quotes, double quotes, slashes, and all else. What I am trying to figure out is, what is my best method to phrase the output of the DB so its friendly for for the JSON request yet can be repieced back together via javascript/jquery. Any takers on that idea? How can i make this hit counter code, so that it doesnt update the views on ALL of my videos. i want it to be unique for each video id. any ideas? Code: [Select] <?php $querySelect = mysql_query("SELECT * FROM `mydatabase` WHERE `counter`"); $row = mysql_fetch_assoc($querySelect); $counter = $row['counter']; if (empty($counter)) { $counter = 1; $insert = mysql_query ("INSERT INTO counter VALUES ('counter')"); } $add = $counter+1; $insertNew = mysql_query("UPDATE mydatabase SET counter=('$add')"); echo "Video Views"; echo ":"; echo" "; echo"<br />"; echo "$counter"; ?> www.game4vids.com if you pick a video you can see that it changes the views on ALL the videos i have. Hi, Posted here as it is in regards to PHP code making MySQL queries. Let's say i had this code below: <?php # Databse query $query = mysql_query("SELECT id, admin, username, first_name, last_name, email FROM `users` WHERE username = '$username' AND password = '$password' LIMIT 1"); # Check login query if(!$query){ echo 'Oops'; } else { echo 'Login Succesful'; } ?> Now this code with slight difference: <?php # Databse query $query = mysql_query("SELECT id, admin, username, first_name, last_name, email FROM `users` WHERE username = '$username' AND password = '$password' LIMIT 1"); # Check login query if(!$query){ echo 'Oops'; } else { if (mysql_num_rows($query) == 1) { echo 'Login Succesful'; } else { echo 'Login Details Invalid'; } } ?> Now my question is in the second lot of code; i am doing a check to ensure that the query is true in terms of username and password match database login credentials by doing mysql_num_rows as in code . Basically do i need to do that extra check in the second lot of code or is the first lot of code fine in checking username and password match database and if not return oops and return Oops if query fails for any other reason ? not sure if i am creating more code that is needed. I am slightly confused see in whether the extra check in second lot of code is needed or not. Could someone please explain in simple terms to me if it is or not and why? Thanks Hello,
I have a website called http://flappycreator.com/ where users can upload multiple images to create their own version of Flappy Bird. As a result of this I created a PHP page that takes a GET param to create a preview image of their game to display in various locations on the website.
Here is an example:
http://flappycreator...d=5305a9ad9dc30
http://flappycreator...d=5305a9ad9dc30
http://flappycreator...d=5305a9ad9dc30
My issue is, I have given my users the ability to upload PNGs or JPGs and trying to figure out reliable code to display the preview has become a huge hassle. In the example above the Pac-Man character shows a white background but when you play the game, it is actually transparent. In other situations I am getting extremely bad color distortion. The code I have provided is my final attempt after a ton of trial-and-error and the PNG imagealphablending() and imagesavealpha() commands have shown me the best results, however I don't know what they do.
Please help! Thanks.
<?php $bird_picture = "default/bird.png"; $tube1_picture = "default/tube1.png"; $tube2_picture = "default/tube2.png"; $ground_picture = "default/ground.png"; $bg_picture = "default/bg.png"; // If an id is set, then reset values if (isset ( $_GET ['id'] )) { require ('XXX.php'); $db = new DBAccess (); $query = "SELECT * FROM XXX WHERE XXX = '{$_GET['id']}'"; $result = $db->query ( $query ); $num_results = $result->num_rows; $row = mysqli_fetch_array ( $result ); if ($num_results != 0) { if ($row ['bird_picture'] != "") { $bird_picture = "instances/" . $row ['folder_dir'] . "/" . $row ['bird_picture']; } if ($row ['tube1_picture'] != "") { $tube1_picture = "instances/" .$row ['folder_dir'] . "/" . $row ['tube1_picture']; } if ($row ['tube2_picture'] != "") { $tube2_picture = "instances/" .$row ['folder_dir'] . "/" . $row ['tube2_picture']; } if ($row ['ground_picture'] != "") { $ground_picture = "instances/" . $row ['folder_dir'] . "/" . $row ['ground_picture']; } if ($row ['bg_picture'] != "") { $bg_picture = "instances/" . $row ['folder_dir'] . "/" . $row ['bg_picture']; } } } $temp = explode(".", $bg_picture); $extension = end($temp); if ($extension == "jpeg" || $extension == "jpg") { $background = imagecreatefromjpeg($bg_picture); } else { $background = imagecreatefrompng($bg_picture); // Turn off alpha blending and set alpha flag imagealphablending($background, true); imagesavealpha($background, true); } $temp = explode(".", $ground_picture); $extension = end($temp); if ($extension == "jpeg" || $extension == "jpg") { $ground = imagecreatefromjpeg($ground_picture); } else { $ground = imagecreatefrompng($ground_picture); // Turn off alpha blending and set alpha flag imagealphablending($ground, false); imagesavealpha($ground, true); } $temp = explode(".", $bird_picture); $extension = end($temp); if ($extension == "jpeg" || $extension == "jpg") { $bird = imagecreatefromjpeg($bird_picture); } else { $bird = imagecreatefrompng($bird_picture); // Turn off alpha blending and set alpha flag imagealphablending($bird, false); imagesavealpha($bird, true); } $temp = explode(".", $tube1_picture); $extension = end($temp); if ($extension == "jpeg" || $extension == "jpg") { $tube1 = imagecreatefromjpeg($tube1_picture); } else { $tube1 = imagecreatefrompng($tube1_picture); // Turn off alpha blending and set alpha flag imagealphablending($tube1, false); imagesavealpha($tube1, true); } $temp = explode(".", $tube2_picture); $extension = end($temp); if ($extension == "jpeg" || $extension == "jpg") { $tube2 = imagecreatefromjpeg($tube2_picture); } else { $tube2 = imagecreatefrompng($tube2_picture); // Turn off alpha blending and set alpha flag imagealphablending($tube2, false); imagesavealpha($tube2, true); } imagecopymerge($background, $tube1, 200, -200, 0, 0, 52, 320, 100); imagecopymerge($background, $tube2, 200, 200, 0, 0, 52, 320, 100); imagecopymerge($background, $ground, 0, 320, 0, 0, 336, 112, 100); imagecopymerge($background, $bird, 70, 190, 0, 0, 36, 26, 100); header('Content-Type: image/png'); imagepng($background); # Destroy imagedestroy($background); imagedestroy($ground); imagedestroy($bird); imagedestroy($tube1); imagedestroy($tube2); ?>Attached Files preview.php 3.31KB 1 downloads Hi, So i have HTML table which i'm attempting to turn into executable SQL code which i can then insert into a SQL database table. I'm wondering if anyone has any good ideas for the best way to get this done? I need to extract the data from each of the <tr bgcolor="#EEEEEE">, scrape the text within each <td></td> and then format it in sql. so far i have removed the html not required and created an array by exploding "<tr bgcolor="#EEEEEE">", however, its creating an empty element in the first array index [0], to fix this i have tried $players = array_shift($players); however it removed everything from the array. next i was thinking i would need to remove all html within each array element and add a comma to the end, then i would need to compress it all back together again? would this be the best way to do this? source html <html> <head> <title><br/></title> <style type ="text/css"> body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } th { padding: 5px; text-align: left; } td { padding: 2px; border-style: solid; border-width: 1px } </style> </head> <body> <center><B><br/> </center></B> <p> <table bordercolor="#000000" width="90%" align="center"> <tr bgcolor="#EEEEEE"> <th>UID</th> <th>Name</th> <th>Nat</th> <th>Position</th> <th>Best Pos</th> <th>Age</th> <th>DoB</th> <th>Height</th> <th>Weight</th> <th>Expires</th> <th>Wage</th> <th>Value</th> <th>Aer</th> <th>Cmd</th> <th>Com</th> <th>Ecc</th> <th>Han</th> <th>Kic</th> <th>1v1</th> <th>Pun</th> <th>Ref</th> <th>TRO</th> <th>Thr</th> <th>Cor</th> <th>Cro</th> <th>Dri</th> <th>Fin</th> <th>Fir</th> <th>Fre</th> <th>Hea</th> <th>Lon</th> <th>L Th</th> <th>Mar</th> <th>Pas</th> <th>Pen</th> <th>Tck</th> <th>Tec</th> <th>Agg</th> <th>Ant</th> <th>Bra</th> <th>Cmp</th> <th>Cnt</th> <th>Dec</th> <th>Det</th> <th>Fla</th> <th>Ldr</th> <th>OtB</th> <th>Pos</th> <th>Tea</th> <th>Vis</th> <th>Wor</th> <th>Acc</th> <th>Agi</th> <th>Bal</th> <th>Jum</th> <th>Nat</th> <th>Pac</th> <th>Sta</th> <th>Str</th> </tr> <tr bgcolor="#EEEEEE"> <td>859596</td> <td>Tim Krul</td> <td>NED</td> <td>GK</td> <td>GK</td> <td>31</td> <td>3/4/1988 (31 years old)</td> <td>194 cm</td> <td>83 kg</td> <td>30/6/2022</td> <td>£25,000 p/w</td> <td>£12.75M</td> <td>15</td> <td>13</td> <td>14</td> <td>8</td> <td>13</td> <td>13</td> <td>15</td> <td>12</td> <td>16</td> <td>15</td> <td>12</td> <td>1</td> <td>2</td> <td>1</td> <td>3</td> <td>8</td> <td>4</td> <td>5</td> <td>3</td> <td>2</td> <td>2</td> <td>9</td> <td>4</td> <td>3</td> <td>8</td> <td>11</td> <td>12</td> <td>14</td> <td>13</td> <td>13</td> <td>12</td> <td>14</td> <td>2</td> <td>14</td> <td>2</td> <td>15</td> <td>10</td> <td>5</td> <td>13</td> <td>11</td> <td>13</td> <td>14</td> <td>17</td> <td>13</td> <td>8</td> <td>14</td> <td>10</td> </tr> <tr bgcolor="#EEEEEE"> <td>5204730</td> <td>Michael McGovern</td> <td>NIR</td> <td>GK</td> <td>GK</td> <td>34</td> <td>12/7/1984 (34 years old)</td> <td>188 cm</td> <td>86 kg</td> <td>30/6/2021</td> <td>£8,000 p/w</td> <td>£875K</td> <td>12</td> <td>11</td> <td>10</td> <td>2</td> <td>12</td> <td>12</td> <td>12</td> <td>11</td> <td>13</td> <td>8</td> <td>10</td> <td>5</td> <td>2</td> <td>1</td> <td>3</td> <td>9</td> <td>7</td> <td>6</td> <td>3</td> <td>3</td> <td>2</td> <td>7</td> <td>1</td> <td>2</td> <td>5</td> <td>7</td> <td>12</td> <td>14</td> <td>13</td> <td>13</td> <td>11</td> <td>17</td> <td>1</td> <td>12</td> <td>7</td> <td>12</td> <td>15</td> <td>10</td> <td>15</td> <td>10</td> <td>13</td> <td>12</td> <td>12</td> <td>12</td> <td>8</td> <td>15</td> <td>14</td> </tr> </table> <p> <p align="center"> </body> </html>
code i've created so far: <?php // Defining the basic scraping function function scrape_between($data, $start, $end) { $data = stristr($data, $start); // Stripping all data from before $start $data = substr($data, strlen($start)); // Stripping $start $stop = stripos($data, $end); // Getting the position of the $end of the data to scrape $data = substr($data, 0, $stop); // Stripping all data from after and including the $end of the data to scrape return $data; // Returning the scraped data from the function } $myfile = fopen("source.html", "r") or die("Unable to open file!"); $page = fread($myfile,filesize("source.html")); $page = scrape_between($page, '</tr>', '</table>'); $players = explode('<tr bgcolor="#EEEEEE">', $page); echo '<pre>'; print_r($players); echo '</pre>'; fclose($myfile); ?> Edited December 14, 2019 by seany1234 Please Help me on how to create a website using with code n a little bit explanation using PHP n phpmyadmin. The mainthing that i need to do is using php create a simple site that logs on by connecting it to the phpmyadmin database such that i need to store the user details like name,mobile number,age,loaction,lattitude n longitude in database.Also i need to retrieve the database whenever required!!! Can Any1 please help how to do this...It means a lot to me n i'm a new User n Beginner to learn these things!!! Thank u for reading this I am refactoring entire collective scattered SQL from my legacy codebase, and into separate classes, and looking for some structure to put it into. Right now I have folders effectively called `DataFromDB` - contains classes that accepts whatever parameters are given, and returns pure data back to the user `DAO` - Data Access Object, which takes that raw data from DB and makes sense out of it and prepares it for consumption by the model/business logic layer objects. That is: - src (folder) |- DAO (folder) | - ProductADAO (classes - take data in, return consumable objects out) | - ProductBDAO | - ... | - ProductZDAO |- DataFromDB (folder) | - ProductAData (classes - contain methods to query pure result sets from DB) | - ProductBData | - ... | - ProductZDataWhenever I need to make a new SQL or refactor an old one I do this: What is this SQL doing? Is it operating on `SomeObjectX`? If yes, find/create class called `ObjectX`, and add a method to it, extracting pure data from DB, put it into `DataFromDB` folder. Write the `DAO` object if needed to transform data into a consumable object. Use the object as is in my code. Does this look like a good strategy? Is there a better one? My problem with this one is that before (now) all the SQL is tightly coupled and is included into the multiple business classes. Using the above strategy will mean I am to be creating many many classes, a lot of classes, most likely one for every few SQL statements. The pros is that it seems like I will achieve a level of code modularity that I wanted. Hello to all. Please I need your help.
I have a web site (php, mysql, dreamweaver) with some seller info in a db table. They want to show a google map with their location of address, that have in the db. Let's say:
Field: Data:
tbAddress 22 Kastelliou street
tbPO 11141
tbLocal Athens
tbCountry Greece
I am try with these iframes that google has on site but this embed is ONLY for what i will find through the address bar. The dynamic web page I have, has the info of the seller (who, where, what) and I want this map dynamically change location, according to the address of the seller from the fields I provided.
Thank you
Hi guys, I have a question, I realised that when I type in my url, for example, www.abc.com, it will automatically lead to www.abc.com/index.php URL, I would like to remain the URL as www.abc.com. How do I achieve that? Thanks Wilson I need to echo out a database value that contains an embed code for soundcloud (music hosting site), into a value of a text input. How do I do this without the object getting rendered? This is an example of an embed code. <object height="81" width="100%"> <param value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fgeneralpie%2Fdukebox001&secret_url=false" name="movie"> <param value="always" name="allowscriptaccess"> <embed height="81" width="100%" type="application/x-shockwave-flash" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fgeneralpie%2Fdukebox001&secret_url=false" allowscriptaccess="always"> </object> The value has to stay exactly the same so that it can pass a regular expression for validation. Is this possible? hi all is there anyway embedding excel or .csv files to the webpage other than the folowing two options . saving it as a webpage . using google docs i used the following code, iam getting the .csv file in the page, but it would be good to have the color formatting, bold, italics... also in the webpage. is it possible? Code: [Select] <?php $cnx = fopen("example.csv", "r"); //open example.csv echo("<table style='border:1px solid #ddd;'>"); // echo the table while (!feof ($cnx)) { // while not end of file $buffer = fgets($cnx); // get contents of file (name) as variable $values = explode(",", $buffer); //explode "," between the values within the contents echo "<tr>"; for ( $j = 0; $j < count($values); $j++ ) { // echo("<td style='border:1px solid #ddd;'>$values[$j]</td>"); } echo"</tr>"; }; echo("</table>"); fclose($cnx); //close filename variable ?> Hello - I'm (very) new to php and working on a project and wondering if anyone can point the direction? (Not necessarily give the answer, but any helpful direction). I need to take YouTube video id's, (built into an array), and post the various video clips. Also the <object> code is in an php array. (Code Below.. hard to explain). Do I need to convert the array text into a string (as shown), and how do I take that string text and paste it into multiple youtube object posts? Note that the original $embedCode is commented out, '//), so that it can be referenced. Any advice is appreciated! <?php $number = 0; $youtubeIds = array("MX0D4oZwCsA","2v-v3jh-Cco","WuYDSa4BRaw","zwo48StJSr4","exOxUAntx8I"); // $embedCode = '<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/__YOUTUBE_ID__?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/__YOUTUBE_ID__?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>'; $string = implode($youtubeIds); $embedCode = '<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/'<?php $string?>'?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'<?php $string?>'?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>'; ?> <!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" lang="en" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/"> <head> <title>Youtube Videos</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> </head> <body> <h1>Youtube Videos</h1> <p><?php for($i = 0; $i < count($youtubeIds); $i++) { echo $embedCode; } ?> </p> </body> </html> I have an excel file that I want to show in PHP page. I dont want this to first download and then view. I want it something like gmail where you just click on the file name and it opens up. Can you please give me an idea as how to do this. Regards, Faisa |