check where data is coming from

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AluminX
Forum Newbie
Posts: 19
Joined: Sat Jul 17, 2004 9:53 am

check where data is coming from

Post 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
lanasa
Forum Newbie
Posts: 14
Joined: Mon Mar 26, 2007 7:49 am
Location: Buffalo, NY

Re: check where data is coming from

Post by lanasa »

Sure, on the received.php page, check the $_SERVER['HTTP_REFERER'] variable to make sure it is from your site.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Be aware that the information is voluntarily supplied by the requesting agent and may be completely false or not exist.
AluminX
Forum Newbie
Posts: 19
Joined: Sat Jul 17, 2004 9:53 am

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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?
Post Reply