Does anyone know an easy solution to adding videos ie. Youtube, etc. to mysql and then displaying them later. My problem is a user can enter a youtube embed link, including the embed object tags and then these video links are displayed on their user page. However, my problem is, when the address gets entered into the database it only saves up to the first slash /. I have tried stripslahing and to no avail. The video displays fine when being passed from form to form, using stripslashes, but when I pull the data from the database, it won't display the videos. Thanks for any help that can be provided. Here is a part of my code:
echo"</td><td bgcolor=\"#000000\" style=\"border:none\" valign=\"top\" align=\"center\"><font size=\"2\" face=\"verdana\" color=\"#ffffff\"><b>ADD VIDEOS</b><br><br>To add videos type in your Video Title. <br>Then paste code from YouTube or other sites into the box below.<br>Please paste in all code including the \"embed\" and \"object\" tags.<br>Not doing so could result in your videos not appearing on your discography page.<br>Each video title must have a unique name.<br><br><b>REMEMBER: All videos linked to this site must be your or your representative's property.<br>If any of your videos is found to be copyrighted by another party,<br> or someone else claims said video as theirs, if found to be true,<br>said video will be deleted and your account will be audited for any other violations.<br>By pressing the Submit button below and linking this video, you agree to the above statement.<br><br></b></td><td bgcolor=\"#000000\" style=\"border:none\"></td></tr><tr><td bgcolor=\"#000000\" style=\"border:none\" valign=\"top\" align=\"center\"><font size=\"2\" face=\"verdana\" color=\"#ffffff\"></td><td bgcolor=\"#000000\" style=\"border:none\" valign=\"top\" align=\"center\"><font size=\"2\" face=\"verdana\" color=\"#ffffff\"><b>Video Title/ Embed Code:</b><form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\"><input type=\"text\" size=\"25\" name=\"vidtitle\"><br><br><textarea cols=\"40\" rows=\"8\" name=\"vidcontents\"></textarea><br><br><input type=\"image\" src=\"images/submitbutton.jpg\" name=\"addvids\"></form></td><td bgcolor=\"#000000\" style=\"border:none\" valign=\"top\" align=\"center\"></td></tr></table></table></center></body>";
if (isset($_POST['addvids_x'])){
echo"<font color=\"#ffffff\">".$_POST['vidcontents'];
echo"<body bgcolor=\"#000000\"><font color=\"#ffffff\" size=\"2\" face=\"verdana\"><center><b>CONFIRM VIDEO</b>
<br><br>If the video you linked doesn't appear below, please click the link below to go back to your videos.<br><br>If it is the correct video click the SUBMIT Button below to add it to your videos.<br><br><b>REMEMBER: The video links must have an \"embed\" tag and/or an \"object\" tag to properly work on CrescendoMusicOnline.com<br><br><a href=\"member.php?addvideos=yes\"><b>THIS ISN'T THE RIGHT VIDEO/ TAKE ME BACK</b></a><br><br><b>Title:</b>"." ".@stripslashes($_POST['vidtitle'])."<br><br></font><font color=\"#000000\"><form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\"><input type=\"hidden\" name=\"createvidtitle\" value=\"".$_POST['vidtitle']."\"><input type=\"hidden\" name=\"createvidcontent\" value=\"".$_POST['vidcontents']."\"><br><input type=\"image\" src=\"images/submitbutton.jpg\" name=\"createvideo\"></form></center></font></body>";
}
if (isset($_POST['createvideo_x'])){
$count = @count($_SESSION['videos']);
$newcount = $count + 1;
$_SESSION['videotitles'][$newcount] = $_POST['createvidtitle'];
$_SESSION['videos'][$newcount] = @stripslashes($_POST['createvidcontent']);
$videos = @serialize($_SESSION['videos']);
$videotitles = @serialize($_SESSION['videotitles']);
$email = $_SESSION['bandlogin'];
mysql_connect("localhost" , "" , "")or die('Database is not responding.');
mysql_select_db("")or die('Unable to connect to database');
mysql_query("")
or die ('Could not reach database' . mysql_error());;;
mysql_close();
$_SESSION['infochanged'] = true;
header('location:member.php?videos=yes');