How to do a preg_match in php?

Silent Kill

New Member
I have this argument in php and i want this to just allow users to enter a domain name...i want it so that it doesnt allow characters like "/" "?" and so on...so i only get the domain name such as "http://somedomain.co.nz" or "http://www.somedomain.co.nz" \[code\]if(!preg_match('/^(http):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i',$_POST['story_url']))\[/code\]Can someone help me add a way i can stop "/" or "?" or anything else to stop from coming on to site...ThanksRoshan
 
Back
Top