fork download
  1. <?php
  2.  
  3. $original = file_get_contents('/pasta/copy.txt');
  4. $ip = file_get_contents('/pasta/origin.txt');
  5. $copia = '/pasta/ok.txt';
  6.  
  7. if ($original == false || $ip == false){
  8. echo "Não foi possível ler algum dos arquivos.";
  9. die();
  10. }
  11.  
  12. $string = str_replace('ASSunto', $ip, $original);
  13.  
  14. if (file_put_contents($copia, $string) === false){
  15. echo "Erro ao gravar no arquivo ". $copia;
  16. } else {
  17. echo "Operação realizada com sucesso.";
  18. }
  19.  
  20. ?>
Success #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Não foi possível ler algum dos arquivos.
stderr
PHP Warning:  file_get_contents(/pasta/copy.txt): failed to open stream: No such file or directory in /home/6mo3YN/prog.php on line 3
PHP Warning:  file_get_contents(/pasta/origin.txt): failed to open stream: No such file or directory in /home/6mo3YN/prog.php on line 4