1
0
mirror of https://github.com/php/doc-pl.git synced 2026-03-24 15:12:16 +01:00
Files
archived-doc-pl/reference/ftp/examples.xml
Maciej Sobaczewski c14218bf94 Sync a ton of simple files with their English counterparts
Well, it doesn't really make the Polish manual much better but it does
reduce the amount of outdated files substantially leaving the ones that
deserve some actual work and thought.
2024-05-08 19:25:35 +02:00

72 lines
1.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 4d1c34c9b7a30cfc3a59641122c707a2812cfed7 Maintainer: sobak Status: ready -->
<!-- $Revision$ -->
<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>Podstawowe użycie</title>
<para>
<example>
<title>Przykład użycia FTP</title>
<programlisting role="php">
<![CDATA[
<?php
// nawiąż podstawowe połączenie
$ftp = ftp_connect($ftp_server);
// zaloguj przy użyciu nazwy użytkownika i hasła
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
// sprawdź połączenie
if ((!$ftp) || (!$login_result)) {
echo "Połączenie FTP nie udało się!";
echo "Próbowano połączyć się z serwerem $ftp_server jako użytkownik $ftp_user_name";
exit;
} else {
echo "Połączono z serwerem $ftp_server jako użytkownik $ftp_user_name";
}
// załaduj plik
$upload = ftp_put($ftp, $destination_file, $source_file, FTP_BINARY);
// sprawdź status wysyłania pliku
if (!$upload) {
echo "Wysyłanie na serwer FTP nie powiodło się!";
} else {
echo "Wysłano $source_file na serwer $ftp_server jako $destination_file";
}
// zamknij połączenie FTP
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
-->