Re: What is the best way to protect the PHP page that returns the AJAX data? [solved]
| From: | Stut | Date: | Sun, 13 May 2007 13:45:16 +0000 |
| Subject: | Re: What is the best way to protect the PHP page that returns the AJAX data? [solved] | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254895@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
On Fri, May 11, 2007 9:59 pm, heavyccasey@gmail.com wrote:Unless the user is using a browser or going through a proxy that strips or replaces the User-Agent header. -StutSet ajaxObject.setRequestHeader("User-Agent","SecretName"); in Javascript and check for it in PHP. Not fool-proof, but the average person wouldn't be able to get in.Unless the user "View Source" and read your AJAX code... This is not going to stop any serious attempt, but as one more defense-in-depth mechanism, it wouldn't hurt.