Mailinglist Archive: opensuse (769 mails)

< Previous Next >
Re: [opensuse] Submitting parameters to php
tOn 05/05/16 20:59, Per Jessen wrote:

Are you new(ish) to PHP? I've been using PHP on apache for maybe ten
years and I've never used "register_globals", I've always considered it
a bad practice.

No, I'm an old PHP user, since 2001 or so. The fact that I'm not familiar with $_GET[] has historical reasons, I try to line out briefly.

Since in PHP 3 and PHP 4.0 (before 2003), parameters could be submitted directly, I had got used to this (bad) style of programming. But in PHP 4.2 this did not work anymore, but there was the workaround of setting "register_globals = On". So, I could keep my old programming style until now. Vices are durable. ;)

This afternoon, I have found a simple trick to use $_GET[] without reprogramming the whole scripts. It is just sufficient to put a line in the beginning of ever script that attributes the values submitted in the URL to the homonymous variable:

$param1 = $_GET["param1"]; $param2 = $_GET["param2"]; etc.

I already tested it with three scripts, and it seems to work pretty well.

Good night,
Wolfgang
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups