forms and method POST - variables

forms and method POST - variables

am 09.01.2008 17:25:35 von moravec

------=_NextPart_000_0046_01C852E4.A5247470
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

Hi,

I have one question about forms and php (which I use for Mysql too).

Do I need for variables from any form in html and method POST (then in =
php
script) to set these variables with:

$variable=3D$_POST['variable'];

=20

For example:





FORM







Input something














=20

And then.in do_something.php

=20





DO SOMETHING






$variable=3D$_POST['variable'];

echo "
Variable: ".$variable;

?>





=20

Because I got some old scripts where I don=B4t have this setting.they =
worked
on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on =
WIN
XP it doesn=B4t work.

=20

Thank you for any advice.

=20

Lukas


------=_NextPart_000_0046_01C852E4.A5247470--

RE: forms and method POST - variables

am 09.01.2008 17:36:03 von MIGUEL ANTONIO GUIRAO AGUILAR

Well, it depends if you use an old version of PHP, in the latest version
both arrays $_POST and $_GET are used to get passed variables!!
I can't remember since what version PHP started to use these arrays!!

MG

-----Original Message-----
From: Luká¹ Moravec [mailto:moravec@ptvservis.cz]
Sent: Miércoles, 09 de Enero de 2008 10:26 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] forms and method POST - variables


Hi,

I have one question about forms and php (which I use for Mysql too).

Do I need for variables from any form in html and method POST (then in php
script) to set these variables with:

$variable=$_POST['variable'];



For example:





FORM







Input something
















And then.in do_something.php







DO SOMETHING






$variable=$_POST['variable'];

echo "
Variable: ".$variable;

?>







Because I got some old scripts where I don´t have this setting.they worked
on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on WIN
XP it doesn´t work.



Thank you for any advice.



Lukas

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: forms and method POST - variables

am 09.01.2008 19:38:12 von parasane

T24gSmFuIDksIDIwMDggMTE6MjUgQU0sIEx1a+G5IE1vcmF2ZWMgPG1vcmF2 ZWNAcHR2c2Vydmlz
LmN6PiB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S4K

Re: forms and method POST - variables

am 10.01.2008 03:05:39 von dmagick

> Because I got some old scripts where I don´t have this setting.they worked
> on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on WIN
> XP it doesn´t work.

You might be using the old format of $HTTP_POST_VARS.

Do a search for that string and change it to

$_POST

and the same for $HTTP_GET_VARS (change to $_GET).


It could also be a side-effect of register_globals being enabled in
php4.0 and not in php5.2.

http://www.php.net/manual/en/security.globals.php

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php