note 47258 added to security.variables

From: Date: Mon, 08 Nov 2004 23:42:12 +0000
Subject: note 47258 added to security.variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-80301@lists.php.net to get a copy of this message
I would like to know how to verify WHERE data is being submitted from. For example: Lets say I have a form, a user copies the source and then changes it in some unfavorable way. How can I know that it is coming from MY DOMAIN NAME. I have used the following: if(isset($_SERVER['HTTP_REFERER']) && ereg("mydomain.com", $_SERVER['HTTP_REFERER'])) { // Seems to validate only good form data } else { // User is trying to send me posion??? } But I do not like it as I feel there is a better way and I am not sure if it will catch all cases, or even most cases. ---- Manual Page -- http://www.php.net/manual/en/security.variables.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47258 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47258&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47258&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47258&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47258&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47258&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47258&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47258&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80301) next »