Is this a BUG?

From: Date: Sun, 23 Jun 2002 22:06:49 +0000
Subject: Is this a BUG?
Groups: php.general 
Request: Send a blank email to php-general+get-103498@lists.php.net to get a copy of this message
Hi all, A couple of days ago, I’ve been starting to organize all my scripts into functions within libraries, and got into a problem this morning. Now, I don’t know if this is a bug or it’s just me getting confused. I got the problem when calling two functions – one gets variables from the other – within the same page. That is, I have a mainusers.php page, which only calls for functions instead of writing them all together inside that page. At one step, it calls for an “adduser” function which brings a table that let the administrator insert a new user. After the submit button is pressed, it calls for a function called “useradded” which resides in the same library as the “adduser” function. This useradded function queries the database, inserting the user. The problem is that it does not get the HTTP_POST_VARS although they are being passed according to phpinfo.php. The structure is this: Project directory >Library Directory >>addlib.php >>>adduser() function >>>useradded() function >Pages directory >>mainusers.php >>>first calls for adduser() >>>and then for useradded() Now, the thing is if I, instead of calling the function, write the query directly in the mainusers.php page, the variables are get well and written into the database. I don’t know if this makes much sense, but the thing is… Isn’t PHP forced to pass those variables before the function is called so when they’re needed they can be get through HTTP_POST_VARS or just $var_name which I like using? Thanks… Cesar Aracena <mailto:webmaster@icaam.com.ar> CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621

« previous php.general (#103498) next »