Toy Posted September 14, 2010 Share Posted September 14, 2010 Okay, so i'm using the basic php mysql insert into function but I have a strange (or maybe not so strange, I just don't get it..) problem.. I have two columns (do you call them columns? I don't really know for sure, whatever things that are in a table whatsoever). Name and Trailer. EDIT: they are TEXT's if that matters Name is really nothing important, just the name. But I want to embed trailers.. If I embed the Megavideo code below: <object width="400" height="300"><param name="movie" value="http://www.megavideo.com/v/8UZFURZQ2b55ada04d73ae65c726a5383b9ee9d9"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/8UZFURZQ2b55ada04d73ae65c726a5383b9ee9d9" type="application/x-shockwave-flash" allowfullscreen="true" width="400" height="300"></embed></object> Everything works fine, no problems and no bullshit. But.. if I for an example try to embed this one (NovaMov): <iframe style='overflow: hidden; border: 0; width: 400px; height: 300px' src='http://embed.novamov.com/embed.php?width=400&height=300&v=xngq7u8yejwbt' scrolling='no'></iframe> It doesn't work. It just doesn't insert. Is inserting an "iframe" a problem or something? I just don't get why the hell it would do this? Does anyone know anything about this? If so i'd be eager and very thankful to hear why and how to fix it. thanks in advance Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 14, 2010 Share Posted September 14, 2010 Uhm I am not sure, but does the Code below work if you just insert it in your html? Also it would be nice if you could be more clear on what doesn't work. So maybe a Before (input value in database) and After (output) That way it's easier to find out if maybe stuff get's stripped etc etc. Right now with my little knowledge all I can do is have a wild guess. Quote Link to comment Share on other sites More sharing options...
gamesmstr Posted September 14, 2010 Share Posted September 14, 2010 It has been a while since I looked at this, but I think Your single quotes are escaping the query. Take a look at the htmlspecialchars() function. It should help you out. Quote Link to comment Share on other sites More sharing options...
Toy Posted September 14, 2010 Author Share Posted September 14, 2010 still not really clear if someone knew whats wrong please post, i'll be grateful Quote Link to comment Share on other sites More sharing options...
coupe-r Posted September 14, 2010 Share Posted September 14, 2010 $link = '<iframe style="overflow: hidden; border: 0; width: 400px; height: 300px" src="http://embed.novamov.com/embed.php?width=400&height=300&v=xngq7u8yejwbt" scrolling="no"></iframe>'; Pass $link into your insert statement. Quote Link to comment Share on other sites More sharing options...
gamesmstr Posted September 14, 2010 Share Posted September 14, 2010 Simple. the ' characters in your data you are sending are exiting your query prior to it's completion. You need to apply a function like htmlspecialchars() to the string for it to store properly. Quote Link to comment 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.