Hi, I have a link submission website in php (Pligg) and I wonder how to force a user to only submit the absolute url -for example http://example.com and not http://example.com/page or http://subdir.example.com. Grateful for any help. Thanks.
<?php if(isset($_GET['url'])){ $url = parse_url($_GET['url']); if($url['path'] != '"){ echo "invalid"; }else{ echo "valid"; } } ?> PHP: save this as check.php and ifyou open yourdomain.com/check.php?url=<url> it will say valid or invalid
Hello, Thanks for the replies! Ok, how can I now make it work for/together with the script I am using? My PHP knowledge is really bad.. Thanks.