PDA

View Full Version : PHP if condition for a certain URL?


futuredood
02-25-2008, 06:32 AM
Can someone help me with an if condition? I don't know PHP too well and have searched the web for this to no avail. I want to know how to do a PHP if condition for a certain url. For example:

"If this exact url is XXXXXX, then load this."

If it makes a difference, I'm trying to this for vBulletin, and for non vBulletin (if it makes a difference). Please let me know if this is even possible!

Dismounted
02-25-2008, 10:18 AM
This can be achieved via PHP's magic constants.
if (__FILE__ == 'http://www.yourdomain.com/file.php')
{
// if it is file.php, do this
}