php/apache question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    php/apache question

    i execute the below command from apache (php script):
    Code:
    <?
    $command="wget http://domain.com/file.php > /dev/null";
    passthru("$command");	
    ?>
    the problem is that after execution on my server is copied 0kb file with the name file.php... i don't want nothing to be copied on my server (this is why i puted there /dev/null)..
    what i'm doing wrong? how can i fix this, so no file to be copyed on my server?
  • calmlikeabomb
    Confirmed User
    • May 2004
    • 1323

    #2
    Simple solution is to execute two commands.
    PHP Code:
    <?php
    
    $command="wget http://domain.com/file.php; rm -f file.php";
    
    shell_exec($command);    
    
    ?>
    subarus.

    Comment

    • xroach
      Confirmed User
      • Feb 2002
      • 963

      #3
      why not just

      file_get_contents("http://domain.com/file.php");

      ?

      Comment

      • mike-al
        Confirmed User
        • Aug 2007
        • 691

        #4
        man wget
        Delete this account, i am done here

        Comment

        Working...