note 46495 deleted from reserved.variables by nlopess
| From: | nlopess@php.net | Date: | Wed, 13 Oct 2004 13:52:05 +0000 |
| Subject: | note 46495 deleted from reserved.variables by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78491@lists.php.net to get a copy of this message | ||
Note Submitter: Cristian
----
Reading a FORM field without distinction to GET or POST method; $field_name is the name of your FORM
field, in string format.
Results: the value of the field; NULL if the field doesn't exists.
<?php
function read_field($field_name) {
$field_value = null;
if ($field_name>"") {
$field_value = $_GET[$field_name];
if ($field_value==null || $field_value=="")
$field_value = $_POST[$field_name];
$field_value = stripslashes($field_value);
}
return $field_value;
}
?>
----
Reason: bad code