> > > I get error : import_request_variables while I make a script to call a
> > > variable.
> > >
> > > This my header (in my script -- error) :
> > >
> > > import_request_variables( "GPC" );
> > >
> > > anybody knows why this happen ?
> >
> >
> > So, what's the exact error PHP gives you?
>
>
> I got this error at browser :
> 
> Fatal error: Call to undefined function: import_request_variables() in
> /var/www/html/zm.php on line 21
>

The import_request_variables() function became available 
in PHP 4.1.0 so you have an older version then this (which 
is a bad idea!), consider upgrading.  The manual has version
information, and phpinfo() tells all (including the PHP
version you're using).

Also, your code is *essentially* a runtime version of the much
hated register_globals PHP directive so you have the following
options to mimick the above behavior:

 1) Upgrade PHP! (preferred)
 2) Turn on register_globals in php.ini or .htaccess
 3) Use extract() on various $HTTP_*_VARS variables

Ideally you'd upgrade PHP and use either the superglobals
and/or use import_requests_variables() by using its second 
parameter, something like:

  import_request_variables('gpc', 'r_');

  echo $r_somevariable;

Adding the prefix is a good idea here as you will KNOW these
variables came via the REQUEST as opposed to being 
somewhere from within your script.  Why do you want to
know this?  Read:

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

So in short you really should upgrade PHP and then use these
request variables as explained here:

  http://www.php.net/manual/en/language.variables.external.php

Regards,
Philip

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

Reply via email to