| | |
Embed Audio , Video content into website
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi,
I am trying to embed audio/video content such as youtube links and playlists from imeem.com into my website for each user of their choice.
What are the measures to be taken to display $user_choice_video variable which is retrieved from database!? I am afraid there might be attacks if i dont take proper measures before displaying it and storing it in database. As htmlentities() will not let the video to display, what should i do to avoid any other code rather than audio/video content on the input?? Also what are the measures to be taken while storing the data into the database.
Any help, guidance is appreciated.
Thank you.
I am trying to embed audio/video content such as youtube links and playlists from imeem.com into my website for each user of their choice.
What are the measures to be taken to display $user_choice_video variable which is retrieved from database!? I am afraid there might be attacks if i dont take proper measures before displaying it and storing it in database. As htmlentities() will not let the video to display, what should i do to avoid any other code rather than audio/video content on the input?? Also what are the measures to be taken while storing the data into the database.
Any help, guidance is appreciated.
Thank you.
Last edited by csharplearner; Apr 28th, 2009 at 7:45 pm.
Well actually I would use htmlentities() to prevent any html from going into the database and at the same time use mysql_real_escape_string(). To help explain below is an example code for a youtube clip:
However the only piece of that you ever need to record into the mysql database is
PHP Syntax (Toggle Plain Text)
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/vWF4x01MkzE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vWF4x01MkzE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>
v/vWF4x01MkzE&hl=en&fs=1 Then you can validate and place that string into the 2 spots where it is needed within the common code. That is all of the code except that little url seems to stay the same with all the youtube scripts. That's how I would do it. Last edited by cwarn23; Apr 29th, 2009 at 3:50 am.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. - MacGyver Fan
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` My favourite PC. - MacGyver Fan
•
•
•
•
Well actually I would use htmlentities() to prevent any html from going into the database and at the same time use mysql_real_escape_string(). To help explain below is an example code for a youtube clip:
However the only piece of that you ever need to record into the mysql database isPHP Syntax (Toggle Plain Text)
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/vWF4x01MkzE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vWF4x01MkzE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>v/vWF4x01MkzE&hl=en&fs=1Then you can validate and place that string into the 2 spots where it is needed within the common code. That is all of the code except that little url seems to stay the same with all the youtube scripts. That's how I would do it.
But if i would like to leave choice to users to input their fav songs from any source then what would be the best approach?
Thanks in advance.
•
•
Join Date: Aug 2008
Posts: 159
Reputation:
Solved Threads: 6
0
#4 Oct 20th, 2009
•
•
•
•
Well actually I would use htmlentities() to prevent any html from going into the database and at the same time use mysql_real_escape_string(). To help explain below is an example code for a youtube clip:
However the only piece of that you ever need to record into the mysql database isPHP Syntax (Toggle Plain Text)
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/vWF4x01MkzE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vWF4x01MkzE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>v/vWF4x01MkzE&hl=en&fs=1Then you can validate and place that string into the 2 spots where it is needed within the common code. That is all of the code except that little url seems to stay the same with all the youtube scripts. That's how I would do it.
Hello sir,
The above code working fine ....
after clicking on the video, it is going to youtube website....but, i want to play my website itself...plz give me some suggestions regarding this...
thanks
Saritha..
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
0
#5 Oct 20th, 2009
Well there are two options. You could try changing the previously mentioned youtube code which I think is called something like the "youtube video api" or you could host each video on your own site using a flv player like I have recently began to do. The best free flv player I have found a great flv player at http://flv-player.net/players/maxi/documentation/ Enjoy.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. - MacGyver Fan
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` My favourite PC. - MacGyver Fan
•
•
Join Date: Aug 2008
Posts: 159
Reputation:
Solved Threads: 6
0
#6 Oct 20th, 2009
•
•
•
•
Well there are two options. You could try changing the previously mentioned youtube code which I think is called something like the "youtube video api" or you could host each video on your own site using a flv player like I have recently began to do. The best free flv player I have found a great flv player at http://flv-player.net/players/maxi/documentation/ Enjoy.
Thank U Cwarn..... my client is not going to host all videos on his servre...so, no prob...
Thanks once again...
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
![]() |
Similar Threads
- dynamically built webpage for multiple audio and text points. (PHP)
- Multiple Audio Items, text, and onclick=play (JavaScript / DHTML / AJAX)
- Play Sound with javascript DHTML (JavaScript / DHTML / AJAX)
- Drop down box won't shut off video on reverse in IE (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: url variables ( /123 instead of ?id=123)
- Next Thread: URL re writting problem
| Thread Tools | Search this Thread |
Tag cloud for PHP
# .htaccess 5.2.10 access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display dissertation download dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail menu mlm mod_rewrite multiple mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote script search server sessions sms soap sockets source space sql syntax system table tutorial update upload url validation validator variable video web xml youtube






