so i have this website where people can submit url's for certain items, but I dont know how i can validate that a url was submitted not just some crap!.
Atm i have this piece of code:
if(filter_var('http://www.example.com/test.html', FILTER_VALIDATE_URL)) {
echo 'this is URL';
} else {
echo 'this is no url!';
}
But this piece of code is easy to bypass since it only checks for "http" in the string, And users will submit "host" separately so i need to check if $host is a valid host.
Thx in advance! you guys rock!