Re: $HTTP_POST_VARS?

From: Date: Mon, 11 Dec 2000 19:46:13 +0000
Subject: Re: $HTTP_POST_VARS?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29742@lists.php.net to get a copy of this message
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

« previous php.general (#29742) next »