mirror of
https://github.com/php/doc-de.git
synced 2026-03-23 23:02:13 +01:00
73 lines
1.8 KiB
XML
73 lines
1.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 4d1c34c9b7a30cfc3a59641122c707a2812cfed7 Maintainer: wiesemann Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<!-- Rev-Revision: 1.0 Reviewer: samesch -->
|
|
|
|
<chapter xml:id="ftp.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
&reftitle.examples;
|
|
<section xml:id="ftp.examples-basic">
|
|
<title>Grundlegende Verwendung</title>
|
|
<para>
|
|
<example>
|
|
<title>FTP-Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Verbindung aufbauen
|
|
$ftp = ftp_connect($ftp_server);
|
|
|
|
// Login mit Benutzername und Passwort
|
|
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
|
|
|
|
// Verbindung überprüfen
|
|
if ((!$ftp) || (!$login_result)) {
|
|
echo "FTP-Verbindung ist fehlgeschlagen!";
|
|
echo "Verbindungsaufbau zu $ftp_server mit Benutzername $ftp_user_name versucht.";
|
|
exit;
|
|
} else {
|
|
echo "Verbunden zu $ftp_server mit Benutzername $ftp_user_name";
|
|
}
|
|
|
|
// Datei hochladen
|
|
$upload = ftp_put($ftp, $destination_file, $source_file, FTP_BINARY);
|
|
|
|
// Upload überprüfen
|
|
if (!$upload) {
|
|
echo "FTP-Upload ist fehlgeschlagen!";
|
|
} else {
|
|
echo "Datei $source_file auf Server $ftp_server als $destination_file hochgeladen";
|
|
}
|
|
|
|
// FTP-Verbindung schließen
|
|
ftp_close($ftp);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</section>
|
|
</chapter>
|
|
|
|
<!-- 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:"~/.phpdoc/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=xml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|