[php] iets.php?blaat=blaa werkt weer, maar

Pagina: 1
Acties:

  • BobDay
  • Registratie: December 2001
  • Laatst online: 11-08-2025
De manier waarop phpmyadmin superglobals oplost is heel handig en daarom zit ik er over te denken dit zelf ook te gaan gebruiken. Alleen wat zijn hier de consequenties van, gezien de veiligheid?

PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/* $Id: grab_globals.lib.php,v 1.5.2.1 2002/05/01 09:30:59 loic1 Exp $ */


/**
 * This library grabs the names and values of the variables sent or posted to a
 * script in the '$HTTP_*_VARS' arrays and sets simple globals variables from
 * them
 *
 * loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
 */
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
    define('PMA_GRAB_GLOBALS_INCLUDED', 1);

    if (!empty($_GET)) {
        extract($_GET, EXTR_OVERWRITE);
    } else if (!empty($HTTP_GET_VARS)) {
        extract($HTTP_GET_VARS, EXTR_OVERWRITE);
    } // end if

    if (!empty($_POST)) {
        extract($_POST, EXTR_OVERWRITE);
    } else if (!empty($HTTP_POST_VARS)) {
        extract($HTTP_POST_VARS, EXTR_OVERWRITE);
    } // end if

    if (!empty($_FILES)) {
        while (list($name, $value) = each($_FILES)) {
            $$name = $value['tmp_name'];
        }
    } else if (!empty($HTTP_POST_FILES)) {
        while (list($name, $value) = each($HTTP_POST_FILES)) {
            $$name = $value['tmp_name'];
        }
    } // end if

} // $__PMA_GRAB_GLOBALS_LIB__
?>

43% of all statistics are worthless


  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 28-08 12:00

Janoz

Moderator Devschuur®

!litemod

Tja, dat is allemaal heel leuk en aardig, maar ze hebben het niet voor niks uitgezet. Daarnaast is het een kleine moeite om het gewoon bij te houden. Dit zou ik alleen toepassen waneer een al bestaande applicatie omgebouwd moet worden. Verder niet...

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • BobDay
  • Registratie: December 2001
  • Laatst online: 11-08-2025
Mijn probleem is alleen dat ik een applicatie heb gebouwd dat dezeflde variabelen binnen krijgt of via de $_POST of via $_GET.

Hoe kan ik het anders weer werkend krijgen?

43% of all statistics are worthless


  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 28-08 12:00

Janoz

Moderator Devschuur®

!litemod

1. Zorgen dat je zeker weet dat het via GET of via POST komt
2. Bovenaan specifiek die vars uit de GET danwel POST array te halen.

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • BierPul
  • Registratie: Juni 2001
  • Laatst online: 00:01

BierPul

2 koffie graag

BobDay schreef op 16 september 2002 @ 15:13:
Mijn probleem is alleen dat ik een applicatie heb gebouwd dat dezeflde variabelen binnen krijgt of via de $_POST of via $_GET.

Hoe kan ik het anders weer werkend krijgen?
$_REQUEST gebruiken/misbruiken :9

Ja man