[Wylug-help] LAMP: form vars not passed to php script

Jason Lander jason at env.leeds.ac.uk
Wed, 8 Jan 2003 10:02:54 +0000 (GMT)


Andy,

I don't know if this is relevant but..

At some point around PHP 4.2, PHP stopped _automatically_ importing form
variables into PHP scripts.

The data is still passed in but, I understand it, the `approved' way of
getting to it is to use the $_GET and $_POST arrays.

  $user = $_GET['user'];

$_GET - as you might be able to guess - holds arguments passed when
METHOD is set to GET, $_POST when it is set to POST.

(HTTP_POST_VARS and HTTP_GET_VARS do a similar job).

You can turn the old behaviour back on with the register_globals flag.

- Jason



--
Jason Lander                       jason@env.leeds.ac.uk

On Wed, 8 Jan 2003, Andy Macdonald wrote:

> I wrote a little app using LAMP which works OK and then built a faster machine
> to run it on: RedHat 7.1, Apache 1.3.27, MySQL 3.23.54a, PHP 4.3.0
> (I also installed OpenSSL 0.9.7 and ModSSL 2.8.12).
>
> I copied all the scripts over and exported and imported the SQL data, but they
> didn't work. Initially this was because I hadn't set up the MySQL user I was
> using to access the data in the PHP script, but now I've fixed that and I find
> that form variables (userid, pwd) from my initial html form don't get through
> to the 'action' script - login.php ??
>
> MIME types in httpd.conf -
>     AddType application/x-httpd-php .php
>     AddType application/x-httpd-php-source .phps
>     AddType application/x-tar .tgz
>
> Can anyone point out my simple blunder?
>
> --
> Andy Macdonald
> Network Manager, Greenhead College
> Huddersfield, HD1 4ES, England.
> Tel: 01484 422032
> Mobile: 07932 635057
> See award winning web site:
> http://www.greenhead.ac.uk
>
>
>
>
>
>
>
> _______________________________________________
> Wylug-help mailing list
> Wylug-help@wylug.org.uk
> http://list.wylug.org.uk/mailman/listinfo/wylug-help
>