Page 1 of 1

check where data is coming from

Posted: Sun Apr 01, 2007 12:49 pm
by AluminX
i did little research about this and found nothing so far.
is there a way to tell from where the data is coming from? i.e. i have a html page on www1.mywebsite.com/new.html and it has a form in it that sends name and last name to a recived.php page. is there a way for php to detect if this information came from www1.mywebsite.com? if yes how?
thanks

Re: check where data is coming from

Posted: Sun Apr 01, 2007 1:24 pm
by lanasa
Sure, on the received.php page, check the $_SERVER['HTTP_REFERER'] variable to make sure it is from your site.

Posted: Sun Apr 01, 2007 1:34 pm
by feyd
Be aware that the information is voluntarily supplied by the requesting agent and may be completely false or not exist.

Posted: Sun Apr 01, 2007 1:54 pm
by AluminX
feyd wrote:Be aware that the information is voluntarily supplied by the requesting agent and may be completely false or not exist.
therefore making it impossible to perform this task safely?

Posted: Sun Apr 01, 2007 2:03 pm
by John Cartwright
Right.. but does it even matter where the data comes from? As long as it's valid.. it shouldn't really matter. Is it critical to check this?