Mailinglist Archive: opensuse (3120 mails)

< Previous Next >
Re: [SLE] PHP Question
  • From: jalal <the_jalal@xxxxxxxxxxx>
  • Date: Mon, 02 Dec 2002 10:19:09 +0100
  • Message-id: <3DEB258D.3020604@xxxxxxxxxxx>
sjb wrote:
dries wrote:


<html>
<body>
<? printf("Test var equals : ".$HTTP_GET_VARS{'testvar'}); ?>
</body>
</html>

Also, take a look in php.ini (usually in /etc) for :

register_globals = On

Just to clarify that a bit...

Old versions of PHP passed the GET variables (and POST etc) into a global namespace and could be accessed as "echo $testvar".
Recent versions of PHP do not register these variables in the global namespace. Although you can change that in the php.ini file.

Its best to always have register_globals set to Off. Then access your variables either as above, or as $_GET['testvar'].

FYI
jalal



--

GPG fingerprint = 3D45 5509 D380 26A4 523E A9D8 A66A 5F38 CA43 BB0E



< Previous Next >
Follow Ups
References