youtube embedding

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

youtube embedding

Post by Da_Elf »

I want to have it so that people who have an account on my site can store youtube videos that they uploaded to be viewed in their profile. ive tried two different ways and neither worked. 1st was to store the whole address in a mysql database. the 2nd was to just store the 11 character end of the address. (just a note my site has the magicquotes thing activated)

Code: Select all

 
<?php
$sqlvid = "SELECT * FROM gallery Where GalUserID='$useid' AND GalV=1 ORDER BY GalEntryID ";
$queryvid = mysql_query($sqlvid, $dbConn);
?>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
        <link href='../website.css' rel='stylesheet' type='text/css'>
    </head>
    <body bgcolor="#94a3b1">
<?php
while ($spv = mysql_fetch_array($queryvid, MYSQL_ASSOC)) { 
        $link = $spv[ 'youtube' ]; ?>
        <br><?php echo $spv[ 'filmname' ];?><br>
        <br>http://www.youtube.com/watch?v=<?php echo "$link"?>&hl=en&fs=1<br>
        <table border="1" cellpadding="0" cellspacing="2" width="501">
            <tr>
            <td><object width="425" height="344"><param name="movie" value="http://www.youtube.com/watch?v=<?php echo '$link'?>&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/watch?v=<?php echo '$link'?>&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></td>
            </tr>
            </table>
<?php } ?>
        </div>
    </body>
 
</html>
 
ive tried many different ways to get the youtube address inserted but nothing seems to work. works fine if i type it in manually. the youtube link inbetween the two <br>s prints the link perfectly and i can capy paste it in another browser and get what i want
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: youtube embedding

Post by Burrito »

what happens when you just echo $spv[ 'youtube' ]; ?

is that key being populated?
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

Re: youtube embedding

Post by Da_Elf »

in line 16 ive used both the echo of $link and the echo of spv['youtube'] and both of them work in line 16 just not in 19. ive gone through a couple different things
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

Re: youtube embedding

Post by Da_Elf »

scrap this post. i figured out where i went wrong
Post Reply