note 98375 deleted from reserved.variables.server by danbrown
| From: | danbrown@php.net | Date: | Fri, 11 Jun 2010 14:23:31 +0000 |
| Subject: | note 98375 deleted from reserved.variables.server by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-170059@lists.php.net to get a copy of this message | ||
Note Submitter: vdboor at codingdomain dot com
----
Note that a few $_SERVER variables are not safe to use at all,
because they are based on information provided by the client-side.
For more information, see:
http://markjaquith.wordpress.com/2009/09/21/
php-server-vars-not-safe-in-forms-or-links/
Notable, to get the current directory (e.g. for opendir(), or config file reading), use:
<?php
$path = dirname(__FILE__);
?>
To post a form to the same URL, use:
<form action="">
An empty URL will redirect the form to the same page.
A single dot (.) will redirect the form to the current folder.