Sophie

Sophie

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

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

<HTML
><HEAD
><TITLE
>curl_setopt</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="CURL, Client URL Library Functions"
HREF="ref.curl.html"><LINK
REL="PREVIOUS"
TITLE="curl_init"
HREF="function.curl-init.html"><LINK
REL="NEXT"
TITLE="curl_version"
HREF="function.curl-version.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.curl-init.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.curl-version.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.curl-setopt"
></A
>curl_setopt</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN10690"
></A
><P
>    (PHP 4 &#62;= 4.0.2)</P
>curl_setopt&nbsp;--&nbsp;Set an option for a CURL transfer</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN10693"
></A
><H2
>Description</H2
>bool <B
CLASS="methodname"
>curl_setopt</B
> ( int ch, string option, mixed value)<BR
></BR
><P
>&#13;     The <B
CLASS="function"
>curl_setopt()</B
> function will set options
     for a CURL session identified by the <TT
CLASS="parameter"
><I
>ch</I
></TT
>
     parameter.  The <TT
CLASS="parameter"
><I
>option</I
></TT
> parameter is the
     option you want to set, and the <TT
CLASS="parameter"
><I
>value</I
></TT
> is
     the value of the option given by the
     <TT
CLASS="parameter"
><I
>option</I
></TT
>.
    </P
><P
>&#13;     The <TT
CLASS="parameter"
><I
>value</I
></TT
> should be a long for the
     following options (specified in the <TT
CLASS="parameter"
><I
>option</I
></TT
>
     parameter):
     <P
></P
><UL
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_INFILESIZE</I
></TT
>: When you are
        uploading a file to a remote site, this option should be used
        to tell PHP what the expected size of the infile will be.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_VERBOSE</I
></TT
>: Set this option to a
        non-zero value if you want CURL to report everything that is
        happening.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_HEADER</I
></TT
>: Set this option to a
        non-zero value if you want the header to be included in the
        output.
       </P
></LI
><LI
><P
>&#13;	<TT
CLASS="parameter"
><I
>CURLOPT_NOPROGRESS</I
></TT
>: Set this option to
	a non-zero value if you don't want PHP to display a progress
	meter for CURL transfers
        <DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Nota: </B
>
          PHP automatically sets this option to a non-zero parameter,
          this should only be changed for debugging purposes.
         </P
></BLOCKQUOTE
></DIV
>
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_NOBODY</I
></TT
>: Set this option to a
        non-zero value if you don't want the body included with the
        output.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_FAILONERROR</I
></TT
>: Set this option to
        a non-zero value if you want PHP to fail silently if the HTTP
        code returned is greater than 300.  The default behaviour is
        to return the page normally, ignoring the code.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_UPLOAD</I
></TT
>: Set this option to a
        non-zero value if you want PHP to prepare for an upload.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_POST</I
></TT
>: Set this option to a
        non-zero value if you want PHP to do a regular HTTP POST.
        This POST is a normal application/x-www-from-urlencoded kind,
        most commonly used by HTML forms.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_FTPLISTONLY</I
></TT
>: Set this option to
        a non-zero value and PHP will just list the names of an FTP
        directory.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_FTPAPPEND</I
></TT
>: Set this option to a
        non-zero value and PHP will append to the remote file instead
        of overwriting it.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_NETRC</I
></TT
>: Set this option to a
        non-zero value and PHP will scan your ~./netrc file to find
        your username and password for the remote site that you're
        establishing a connection with.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_FOLLOWLOCATION</I
></TT
>: Set this option
        to a non-zero value to follow any "Location: " header that the
        server sends as a part of the HTTP header (note this is
        recursive, PHP will follow as many "Location: " headers that
        it is sent.)
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_PUT</I
></TT
>: Set this option a non-zero
        value to HTTP PUT a file.  The file to PUT must be set with
        the CURLOPT_INFILE and CURLOPT_INFILESIZE.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_MUTE</I
></TT
>: Set this option to a
        non-zero value and PHP will be completely silent with regards
        to the CURL functions.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_TIMEOUT</I
></TT
>: Pass a long as a
        parameter that contains the maximum time, in seconds, that
        you'll allow the curl functions to take.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_LOW_SPEED_LIMIT</I
></TT
>: Pass a long as
        a parameter that contains the transfer speed in bytes per
        second that the transfer should be below during
        CURLOPT_LOW_SPEED_TIME seconds for PHP to consider it too slow
        and abort.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_LOW_SPEED_TIME</I
></TT
>: Pass a long as
        a parameter that contains the time in seconds that the
        transfer should be below the CURLOPT_LOW_SPEED_LIMIT for PHP
        to consider it too slow and abort.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_RESUME_FROM</I
></TT
>: Pass a long as a
        parameter that contains the offset, in bytes, that you want
        the transfer to start from.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_SSLVERSION</I
></TT
>: Pass a long as a
        parameter that contains the SSL version (2 or 3) to use.  By
        default PHP will try and determine this by itself, although,
        in some cases you must set this manually.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_TIMECONDITION</I
></TT
>: Pass a long as a
        parameter that defines how the CURLOPT_TIMEVALUE is treated.
        You can set this parameter to TIMECOND_IFMODSINCE or
        TIMECOND_ISUNMODSINCE.  This is a HTTP-only feature.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_TIMEVALUE</I
></TT
>: Pass a long as a
        parameter that is the time in seconds since January 1st, 1970.
        The time will be used as specified by the CURLOPT_TIMEVALUE
        option, or by default the TIMECOND_IFMODSINCE will be used.
       </P
></LI
></UL
>
    </P
><P
>&#13;     The <TT
CLASS="parameter"
><I
>value</I
></TT
> parameter should be a string for
     the following values of the <TT
CLASS="parameter"
><I
>option</I
></TT
>
     parameter:
     <P
></P
><UL
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_URL</I
></TT
>: This is the URL that you
        want PHP to fetch.  You can also set this option when
        initializing a session with the <A
HREF="function.curl-init.html"
><B
CLASS="function"
>curl_init()</B
></A
>
        function.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_USERPWD</I
></TT
>: Pass a string
        formatted in the [username]:[password] manner, for PHP to use
        for the connection.  connection.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_PROXYUSERPWD</I
></TT
>: Pass a string
        formatted in the [username]:[password] format for connection
        to the HTTP proxy.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_RANGE</I
></TT
>: Pass the specified range
        you want.  It should be in the "X-Y" format, where X or Y may
        be left out.  The HTTP transfers also support several
        intervals, seperated with commas as in X-Y,N-M.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_POSTFIELDS</I
></TT
>: Pass a string
        containing the full data to post in an HTTP "POST" operation.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_REFERER</I
></TT
>: Pass a string
        containing the "referer" header to be used in an HTTP request.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_USERAGENT</I
></TT
>: Pass a string
        containing the "user-agent" header to be used in an HTTP
        request.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_FTPPORT</I
></TT
>: Pass a string
        containing the which will be used to get the IP address to use
        for the ftp "PORT" instruction.  The POST instruction tells
        the remote server to connect to our specified IP address.  The
        string may be a plain IP address, a hostname, a network
        interface name (under UNIX), or just a plain '-' to use the
        systems default IP address.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_COOKIE</I
></TT
>: Pass a string
        containing the content of the cookie to be set in the HTTP
        header.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_SSLCERT</I
></TT
>: Pass a string
        containing the filename of PEM formatted certificate.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_SSLCERTPASSWD</I
></TT
>: Pass a string
        containing the password required to use the CURLOPT_SSLCERT
        certificate.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_COOKIEFILE</I
></TT
>: Pass a string
        containing the name of the file containing the cookiee data.
        The cookie file can be in Netscape format, or just plain
        HTTP-style headers dumped into a file.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_CUSTOMREQUEST</I
></TT
>: Pass a string to
        be used instead of GET or HEAD when doing an HTTP request.
        This is useful for doing DELETE or another, more obscure, HTTP
        request.
        <DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Nota: </B
>
          Don't do this without making sure your server supports the
          command first.
         </P
></BLOCKQUOTE
></DIV
>
       </P
></LI
></UL
>
    </P
><P
>&#13;     The following options expect a file descriptor that is obtained
     by using the <A
HREF="function.fopen.html"
><B
CLASS="function"
>fopen()</B
></A
> function:
     <P
></P
><UL
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_FILE</I
></TT
>: The file where the output
        of your transfer should be placed, the default is STDOUT.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_INFILE</I
></TT
>: The file where the
        input of your transfer comes from.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_WRITEHEADER</I
></TT
>: The file to write
        the header part of the output into.
       </P
></LI
><LI
><P
>&#13;        <TT
CLASS="parameter"
><I
>CURLOPT_STDERR</I
></TT
>: The file to write
        errors to instead of stderr.
       </P
></LI
></UL
>
    </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.curl-init.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.curl-version.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>curl_init</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.curl.html"
ACCESSKEY="U"
>Subir</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>curl_version</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>