Page 1 of 1

protect post from other domain

Posted: Tue Jun 22, 2010 7:36 am
by srdva59
hi,
i have a php file that perform a query with the data that he receive
form post information.
what i need to do is detect from where the data is coming is is same domain
or not and block when is not from the same domain.
thanks a lot for your help :)

Re: protect post from other domain

Posted: Tue Jun 22, 2010 12:15 pm
by AbraCadaver
You could check $_SERVER['HTTP_REFERRER'], but it would probably be better to implement a one-time token. Check here: http://shiflett.org/articles/cross-site ... -forgeries