<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ftp.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.ftp-site.php',
    1 => 'ftp_site',
    2 => 'Invia al server un comando SITE',
  ),
  'up' => 
  array (
    0 => 'ref.ftp.php',
    1 => 'FTP Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.ftp-set-option.php',
    1 => 'ftp_set_option',
  ),
  'next' => 
  array (
    0 => 'function.ftp-size.php',
    1 => 'ftp_size',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/ftp/functions/ftp-site.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ftp-site" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">ftp_site</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ftp_site</span> &mdash; <span class="dc-title">Invia al server un comando SITE</span></p>

   </div>
   <div class="refsect1 unknown-1057" id="refsect1-function.ftp-site-unknown-1057">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>ftp_site</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$ftp_stream</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$cmd</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

    <p class="para rdfs-comment">
     La funzione <span class="function"><strong>ftp_site()</strong></span> invia al server FTP
     il comando specificato dal parametro <code class="parameter">cmd</code>.
     I comandi SITE non sono standardizzati e sono diversi da server a server.  They are
     Sono utili per operare, ad esempio, sui permessi dei file o sull&#039;appartenenza a
     gruppi.
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Invio di un comando SITE ad un server ftp</strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/* Connessione al server FTP */<br /></span><span style="color: #0000BB">$conn </span><span style="color: #007700">= </span><span style="color: #0000BB">ftp_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'ftp.example.com'</span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$conn</span><span style="color: #007700">) die(</span><span style="color: #DD0000">'Impossibile connettersi a ftp.example.com'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Collegarsi come "user" con password "pass" */<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">ftp_login</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">, </span><span style="color: #DD0000">'user'</span><span style="color: #007700">, </span><span style="color: #DD0000">'pass'</span><span style="color: #007700">)) die(</span><span style="color: #DD0000">'Errore nel collegamento come "user" a ftp.example.com'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Invio: comando "SITE CHMOD 0600 /home/user/privatefile" al server ftp */<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">ftp_site</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">, </span><span style="color: #DD0000">'CHMOD 0600 /home/user/privatefile'</span><span style="color: #007700">)) {<br />   echo </span><span style="color: #DD0000">"Comando eseguito correttamente.\n"</span><span style="color: #007700">;<br />} else {<br />   die(</span><span style="color: #DD0000">'Errore nell'</span><span style="color: #0000BB">esecuzione del comando</span><span style="color: #007700">.</span><span style="color: #DD0000">');<br />}<br />?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <p class="para">
     Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> in caso di successo, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
    </p>
    <p class="simpara">
     Vedere anche:
     <span class="function"><a href="function.ftp-raw.php" class="function">ftp_raw()</a></span>
    </p>
   </div>

  </div><?php manual_footer($setup); ?>