2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-06-19 15:42:56 +00:00
|
|
|
<!-- $Revision: 1.10 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/ftp.xml, last change in rev 1.32 -->
|
|
|
|
<refentry id='function.ftp-exec'>
|
|
|
|
<refnamediv>
|
|
|
|
<refname>ftp_exec</refname>
|
2002-09-17 09:46:58 +00:00
|
|
|
<refpurpose>Requests execution of a program on the FTP server</refpurpose>
|
2002-04-15 00:12:54 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>ftp_exec</methodname>
|
2002-05-14 22:38:03 +00:00
|
|
|
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
|
2002-04-15 00:12:54 +00:00
|
|
|
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Sends a SITE EXEC <parameter>command</parameter> request to the FTP
|
2003-05-25 22:30:27 +00:00
|
|
|
server. Returns &true; if the command was successful (server sent response code:
|
2003-01-31 05:19:42 +00:00
|
|
|
<literal>200</literal>); otherwise returns &false;.
|
|
|
|
</para>
|
2003-08-17 13:14:23 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>ftp_exec</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$command = 'ls -al';
|
|
|
|
|
|
|
|
$conn_id = ftp_connect($ftp_server);
|
|
|
|
|
|
|
|
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
|
|
|
|
|
2004-06-19 15:42:56 +00:00
|
|
|
if (ftp_exec($conn_id, $command)) {
|
2003-08-17 13:14:23 +00:00
|
|
|
echo "$command executed successfully<br />\n";
|
|
|
|
} else {
|
|
|
|
echo 'could not execute ' . $command;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2003-01-31 05:19:42 +00:00
|
|
|
<para>
|
2003-06-29 15:05:37 +00:00
|
|
|
See also <function>ftp_raw</function>.
|
2002-04-15 00:12:54 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|