PDA

View Full Version : How do i do this ?


veenuisthebest
09-15-2008, 03:30 AM
In my PHP script, I want to change directory only when the user has referred from the root of the domain i.e. http://www.domain.com and NOT when referred from http://www.domain.com/forum

something like this:-

if(referrer = "http://www.domain.com")
{
chdir('forum');
}
else
{
no chdir
}

how do I achieve this ?

thank you

Dismounted
09-15-2008, 05:27 AM
A much easier way than relying on easily falsified referrers, is to just use chdir() with an absolute path. For example:
chdir('/home/someuser/public_html/forum/');

veenuisthebest
09-15-2008, 11:03 PM
thank you so much. works perfect !