How To Validate Check Correct Embed Code Like Youtube Videos
how to validate check correct embed code like youtube videos
how, to, validate, check, correct, embed, code, like, youtube, videos
How To Validate Check Correct Embed Code Like Youtube Videos
Post Description: how to validate check correct embed code like youtube videos
POST# 1058
Posted On: Fri Feb 29, 2008 12:01 pm
validator
Topic: How To Validate Check Correct Embed Code Like Youtube Videos
hi, i have php and i want my visitors to be able to add youtube vidoes with their comments, but i was wondering if you guys know of a snippet or a function that would validate with php tha tthe submitted embeded code is correct.
Share:
BBCODE:
HTML Code:


Fri Nov 16, 2007 10:46 am
1
rin hayashi
Reply #1781
if u r looking 4 a hacker or a virous then i might b able 2 help u!
Tue May 06, 2008 9:13 am
2
webune
Reply #2021
with php is very easy to do, just create a regular expression so that it searches for your format.

for example, any embeded code from youtube will have to have two characteristics,

1. the embed tag
2. the youtube domain

so make a function to check for this, if the user has entered both of the above, then you can approve the code, if not send a error message to the user or reject the information sent by the user via a web form.

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload