I want to validation in form where user enter url without extention for example : www.example.com is not valide and www.example is valid
It's pretty simple you would have something like this; <?php $url = $_POST['url']; if(contains($url)) { error } else { carry on } ?> HTML: Of coarse that isn't exactly the exact code, But I'd rather give you an idea than do the whole code for you, otherwise you won't learn. All you would possibly need to do is get the posted data, and see if it 'contains' maybe an array of TLD's, and if it does, reject. etc.