pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

PHP paste-bin - collaborative debugging tool View Help


Posted by ramses on Wed 2nd May 16:54
download | new post

  1. if($numfotos > "0") {
  2.                         print '<form name="fotos" method="post" action="fotosload.php?enviar=ok" enctype="multipart/form-data">';
  3.                         print '<input type="hidden" name="numfotos2" value="'.$numfotos.'">
  4.                                 <input type="hidden" name="id2" value="'.$id.'">';
  5.                 for ($i=1; $i<=$numfotos; $i++)
  6.                         print '<p align="center">Foto' .$i. '<input type="file" name="foto'.$id.$i.'"><br>';
  7.                 print '<input type="Submit" name="enviar" value="Enviar fotos"></p></form>';
  8.                 }
  9.  
  10.  
  11.  
  12. --- handler do formulário:
  13.  
  14. if ($_GET['enviar']=="ok") {
  15.  
  16.         $Conectar = ftp_connect($ftp_Host);
  17.         ftp_login($Conectar, $ftp_User, $ftp_Senha);
  18.         for ($i=1;$i<=$_POST['numfotos2'];$i++) {
  19.                 $sourcefile = $_POST["foto".$_POST['id2'].$i;
  20.                 $Filename = $ftp_Root .  $sourcefile;
  21.                 $status = ftp_put($Conectar, $Filename, $sourcefile, FTP_BINARY);
  22.                 if($status) {
  23.                         echo "<p align='center'>Foto $i enviada com sucesso!</p>";
  24.                 } else {
  25.                         echo "<p align='center'>O envio da foto $i falhou! Tente novamente</p>";
  26.                 }
  27.         }
  28. }
  29.  else
  30.  {
  31.          echo "<br><br><br><p align='center'>Erro, você não selecionou todas as fotos corretamente!</p>";
  32.  }

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@
:
:
Remember my settings