leszek Sun Apr 16 11:49:21 2006 UTC
Modified files:
/phpdoc/en/reference/ftp/functions ftp-exec.xml
Log:
- example unification
http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/ftp/functions/ftp-exec.xml?r1=1.12&r2=1.13&diff_format=u
Index: phpdoc/en/reference/ftp/functions/ftp-exec.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-exec.xml:1.12
phpdoc/en/reference/ftp/functions/ftp-exec.xml:1.13
--- phpdoc/en/reference/ftp/functions/ftp-exec.xml:1.12 Sun Jan 16 05:09:23 2005
+++ phpdoc/en/reference/ftp/functions/ftp-exec.xml Sun Apr 16 11:49:21 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.12 $ -->
+<!-- $Revision: 1.13 $ -->
<refentry id='function.ftp-exec'>
<refnamediv>
<refname>ftp_exec</refname>
@@ -56,18 +56,25 @@
<![CDATA[
<?php
+// variable initialization
$command = 'ls -al >files.txt';
+// set up basic connection
$conn_id = ftp_connect($ftp_server);
+// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
+// execute command
if (ftp_exec($conn_id, $command)) {
- echo "$command executed successfully<br />\n";
+ echo "$command executed successfully\n";
} else {
- echo 'could not execute ' . $command;
+ echo "could not execute $command\n";
}
+// close the connection
+ftp_close($conn_id);
+
?>
]]>
</programlisting>