ecabrera Posted March 22, 2012 Share Posted March 22, 2012 Why is it when a save a youtube video on my db it gives me this <iframe width="220" height="240" src="http://www.youtube.com/embed/DCZ2l1BbWyY?wmode=opaque" frameborder="0" allowfullscreen></iframe><br> i have to save it twice so it can be view why if you want to see my edit videos page i will add it here Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/ Share on other sites More sharing options...
ecabrera Posted March 22, 2012 Author Share Posted March 22, 2012 <?php require "scripts/connect.php"; if($_POST['submitbtn']){ $video1 = mysql_real_escape_string($_POST['video1']); $video2 = mysql_real_escape_string($_POST['video2']); $video3 = mysql_real_escape_string($_POST['video3']); $video4 = mysql_real_escape_string($_POST['video4']); if($video1){ if($video2){ if($video3){ if($video4){ $query = mysql_query("UPDATE videos SET video1='$video1',video2='$video2',video3='$video3',video4='$video4'"); header("location: http://www.mywebsite/admin/editvideos"); }else $msg = "PLEASE FILL IN"; }else $msg = "PLEASE FILL IN"; }else $msg = "PLEASE FILL IN"; }else $msg = "PLEASE FILL IN"; } mysql_close(); ?> <?php include "header.php";?> <?php if($email){?> <?php include "inc/nav.php"; ?> <div id="righthomecontent"> <?php require "scripts/connect.php"; $query = mysql_query("SELECT * FROM videos"); $rows = mysql_fetch_assoc($query); $video1 = stripslashes($rows['video1']); $video2 = stripslashes($rows['video2']); $video3 = stripslashes($rows['video3']); $video4 = stripslashes($rows['video4']); mysql_close(); ?> <center>MUST USE THIS IN VIDEOS ?wmode=opaque"</center><br> <center>All videos are Width='220' and Height='240'</center><br> <form class="editvideoform" action="editvideos" method="post"> <table> <tr> <td></td> <td><?php echo $msg;?></td> </tr> <tr> <td>VIDEO 1</td> <td><textarea cols=25 rows=10 name="video1"><?php echo $video1;?></textarea></td> </tr> <tr> <td>VIDEO 2</td> <td><textarea cols=25 rows=10 name="video2"><?php echo $video2;?></textarea></td> </tr> <tr> <td>VIDEO 3</td> <td><textarea cols=25 rows=10 name="video3"><?php echo $video3;?></textarea></td> </tr> <tr> <td>VIDEO 4</td> <td><textarea cols=25 rows=10 name="video4"><?php echo $video4;?></textarea></td> </tr> <tr> <td></td> <td><input type="submit" name="submitbtn" value="SUBMIT" /></td> </tr> </table> </form> </div> <?php } else { echo "<center><h1>PLEASE LOGIN</h1></center>"; } ?> <?php include "footer.php";?> Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/#findComment-1330209 Share on other sites More sharing options...
onlyican Posted March 22, 2012 Share Posted March 22, 2012 mysql_real_escape_string() is changing the < to friendly < The best method would be just to store the embed ID Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/#findComment-1330211 Share on other sites More sharing options...
ecabrera Posted March 22, 2012 Author Share Posted March 22, 2012 but before it didnt give me any problems Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/#findComment-1330213 Share on other sites More sharing options...
Muddy_Funster Posted March 22, 2012 Share Posted March 22, 2012 not sure exactly what the issue is here, but have you tried html_entity_decode() before sending the link to the page? Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/#findComment-1330215 Share on other sites More sharing options...
ecabrera Posted March 22, 2012 Author Share Posted March 22, 2012 ok so i tried what you said $video4 = mysql_real_escape_string(html_entity_decode($_POST['video4'])); and it worked thanks Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/#findComment-1330217 Share on other sites More sharing options...
Muddy_Funster Posted March 22, 2012 Share Posted March 22, 2012 no problem, glad you got it worked out. Quote Link to comment https://forums.phpfreaks.com/topic/259497-some-crazy-stuff/#findComment-1330228 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.