Page 1 of 1

can someone check this for me

Posted: Mon Nov 30, 2009 6:05 am
by chris_s_22
both of these are suposed to check url is in correct format?

this should only alow http:// with domain name
with no folder extentions

Code: Select all

if(!preg_match("/^http://[0-9a-zA-Z-.].[a-zA-Z]{2,3}$/", $_POST[linkto]))
this should alow as above but with folder ext

Code: Select all

if(!preg_match("/^http://(www.[0-9a-zA-Z][0-9a-zA-Z-][0-9a-zA-Z]|[0-9a-zA-Z][0-9a-zA-Z-][0-9a-zA-Z]).[a-zA-Z]{2,3}[0-9a-zA-Z/-_.]$/", $_POST[linkfrom]))