TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-18-2008, 06:48 PM   #41 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

ok now im not the best at regex, so perhaps Salathe or someone could produce something better, but heres a rule that seems to work.
Code:
'~^http://(w{3}\.|[a-z]{2}\.)youtube\.com/watch\?v=[\w-]{11}$~i'
I think the video ID is 11 chars in length, not sure though.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 10-18-2008 at 06:59 PM. Reason: edited error in regex
sketchMedia is offline  
Reply With Quote
Old 10-18-2008, 11:26 PM   #42 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Smile

PHP Code:
'/^[url]http://([/url][a-z]{2,3}\.)?youtube\.com\/watch\?v=([\w-]+)/i' 
this is what i came up with :S

will try some stuff out i let you know soon ;)

Last edited by codefreek : 10-19-2008 at 01:50 AM.
codefreek is offline  
Reply With Quote
Old 10-19-2008, 01:56 AM   #43 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

I fixed it everything is working now ;)

Thank you everyone for all the help!

Last edited by codefreek : 10-19-2008 at 01:57 AM. Reason: TY
codefreek is offline  
Reply With Quote
Old 10-19-2008, 06:05 AM   #44 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

what's the code? now i am intrigued of how it works :P
tony is offline  
Reply With Quote
Old 10-19-2008, 06:12 PM   #45 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

it was mostly the regex part that needed a fix and also some brackets was miss placed and so on.. but yeah that's the big change ;P
codefreek is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:04 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design