youtube embedding
Posted: Thu Jan 22, 2009 10:30 am
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)
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
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>