Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > a34ed6838d4b29d38abd504392a4a797 > files > 1172

php-manual-es-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>import_request_variables</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual de PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Funciones sobre variables"
HREF="ref.variables.html"><LINK
REL="PREVIOUS"
TITLE="gettype"
HREF="function.gettype.html"><LINK
REL="NEXT"
TITLE="intval"
HREF="function.intval.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual de PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.gettype.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.intval.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.import-request-variables"
></A
>import_request_variables</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN78133"
></A
><P
>    (PHP 4 &#62;= 4.1.0)</P
>import_request_variables&nbsp;--&nbsp;Import GET/POST/Cookie variables into the global scope</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN78136"
></A
><H2
>Description</H2
>bool <B
CLASS="methodname"
>import_request_variables</B
> ( string types [, string prefix])<BR
></BR
><P
>&#13;     Imports GET/POST/Cookie variables into the global scope. It is
     useful if you disabled
     <A
HREF="missing-stuff.html#ini.register-globals"
>register_globals</A
>,
     but would like to see some variables in the global scope.
    </P
><P
>&#13;     Using the <TT
CLASS="parameter"
><I
>types</I
></TT
> parameter, you can
     specify which request variables to import. You can use
     'G', 'P' and 'C' characters respectively for GET, POST and
     Cookie. These characters are not case sensitive, so you
     can also use any combination of 'g', 'p' and 'c'. POST
     includes the POST uploaded file information. Note that the
     order of the letters matters, as when using "gp", the POST
     variables will overwrite GET variables with the same
     name. Any other letters than GPC are discarded.
    </P
><P
>&#13;     The <TT
CLASS="parameter"
><I
>prefix</I
></TT
> parameter is used as a variable
     name prefix, prepended before all variable's name imported into the
     global scope. So if you have a GET value named "userid", and provide
     a prefix "pref_", then you'll get a global variable named
     $pref_userid.
    </P
><P
>&#13;     If you're interested in importing other variables 
     into the global scope, such as SERVER, consider using 
     <A
HREF="function.extract.html"
><B
CLASS="function"
>extract()</B
></A
>.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Nota: </B
>
      Although the <TT
CLASS="parameter"
><I
>prefix</I
></TT
> parameter is
      optional, you will get an 
      <A
HREF="phpdevel-errors.html#internal.e-notice"
>E_NOTICE</A
> level error if 
      you specify no prefix, or specify an empty string as a
      prefix. This is a possible security hazard. Notice
      level errors are not displayed using the default
      <A
HREF="configuration.html#ini.error-reporting"
>error reporting</A
>
      level.
     </P
></BLOCKQUOTE
></DIV
><DIV
CLASS="informalexample"
><A
NAME="AEN78160"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>// This will import GET and POST vars
// with an "rvar_" prefix
import_request_variables("gP", "rvar_");

print $rvar_foo;</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;     See also <A
HREF="reserved.variables.html#reserved.variables.request"
>$_REQUEST</A
>, 
     <A
HREF="missing-stuff.html#ini.register-globals"
>register_globals</A
>,
     <A
HREF="language.variables.predefined.html"
>Predefined Variables</A
>, 
     and <A
HREF="function.extract.html"
><B
CLASS="function"
>extract()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.gettype.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Inicio</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.intval.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>gettype</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.variables.html"
ACCESSKEY="U"
>Subir</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>intval</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>