recebe.php
Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
Próxima revisão | Revisão anterior | ||
recebe.php [2008/10/15 12:29] – Nova página: Script "recebe.php", que recebe dados enviados via http. <source lang="php"> <? # recebe arquivo if (!empty($_POST['nome'])) { $fh = fopen($_POST['nome'],"w"); $dados = bas... cartola | recebe.php [2009/02/17 22:21] (atual) – nova versao que faz upload direto para subpasta cartola | ||
---|---|---|---|
Linha 1: | Linha 1: | ||
- | Script " | + | Script " |
<? | <? | ||
+ | # cria pasta destino, se necessario | ||
+ | if (!empty($_POST[' | ||
+ | if ( !file_exists($_POST[' | ||
+ | mkdir($_POST[' | ||
+ | } | ||
+ | if ( !file_exists($_POST[' | ||
+ | copy(" | ||
+ | } | ||
+ | } | ||
+ | # verifica se arquivo ja existe | ||
+ | if (!empty($_GET[' | ||
+ | if ( file_exists($_GET[' | ||
+ | print " | ||
+ | } else { | ||
+ | print " | ||
+ | } | ||
+ | exit; | ||
+ | } | ||
# recebe arquivo | # recebe arquivo | ||
if (!empty($_POST[' | if (!empty($_POST[' | ||
Linha 21: | Linha 38: | ||
$md5 = system($cmd); | $md5 = system($cmd); | ||
print $_POST[' | print $_POST[' | ||
+ | } | ||
+ | # atualiza data do arquivo | ||
+ | if (!empty($_POST[' | ||
+ | $cmd = "touch -t " . $_POST[' | ||
+ | $execucao = system($cmd); | ||
} | } | ||
?> | ?> | ||
recebe.php.1224073776.txt.gz · Última modificação: 2008/10/15 12:29 por cartola