Hello,
I would like to check if a URL a user inputs is from a specific website (ex. If I want it to be from google.com, the URL http://en.wikipedia.org/wiki/ would return false).
I can't figure out how to do this,
Thanks
Check if URL is of a specific website
Moderator: General Moderators
Re: Check if URL is of a specific website
Not sure what you want to happen but this could work?
if((strpos($URL,google.com)) != false){
echo "true";
}
if((strpos($URL,google.com)) != false){
echo "true";
}
- arrielmabale
- Forum Newbie
- Posts: 15
- Joined: Fri Aug 13, 2010 3:57 pm
- Location: Dubai
Re: Check if URL is of a specific website
$URL = $_SERVER['HTTP_REFERER'];
if((strpos($URL,google.com)) != false){
echo "true";
}
if((strpos($URL,google.com)) != false){
echo "true";
}