RE: [PHP] $HTTP_POST_VARS?
| From: | Yu En Lue | Date: | Tue, 12 Dec 2000 06:49:01 +0000 |
| Subject: | RE: [PHP] $HTTP_POST_VARS? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29832@lists.php.net to get a copy of this message | ||
Thanks!! This works! :-D
-----Original Message-----
From: root@ns2.datawarebi.net [mailto:root@ns2.datawarebi.net]On Behalf Of Carlos Fernando
Sent: Tuesday, December 12, 2000 3:46 AM
To: php-general@lists.php.net; eric@ms.raydia.com
Subject: Re: [PHP] $HTTP_POST_VARS?
Importance: High
eric wrote:
> Hi,
> I am currently using FBSD 4 + Apache 1.3.14+modssl + mod_php4,
>
> I am writing a basic user DB system, the Login.php is put under
> my public_html, and the code is
>
> $userDB = pg_connect("host=localhost user=eric password=123
> dbname=ECUsers");
>
> if($userDB)
> echo("Connected to DB...");
>
> echo(phpinfo());
> echo("postcount=".count($HTTP_POST_VARS));
> echo("getcount=".count($HTTP_GET_VARS));
> for ($i; sizeof ($HTTP_POST_VARS); $i++)
> {
> echo key($HTTP_POST_VARS);next ($HTTP_POST_VARS);
> }
> $userID = $HTTP_POST_VARS["userID"];
> echo("userID=$userID");
> echo("userID2=".$HTTP_POST_VARS["userID"]);
> $password = $HTTP_POST_VARS["passwd"];
>
> Strangely, the phpinfo() did exist the userID and password and
> shows:
> HTTP_POST_VARS["userID"] erewf
> HTTP_POST_VARS["passwd"] wefrwe
>
> However, using $HTTP_POST_VARS["userID"] seems no effect,
> Does anyone know what's going on??
>
> Thanks!!!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
Hello Eric,
Yes, try this on the function : Declare the HTTP_POST_VARS as global like this
:
function login($Name,$Password) {
global $HTTP_POST_VARS
}
if you don't do that the system will think that HTTP_POST_VARS is a local
array or variable and you won't seen anything on it.
regards,
Carlos Fernando Scheidecker Antunes