Help: Re" Need something that will grab two txt files from a url and combine....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • juicylinks
    So Fucking Banned
    • Apr 2001
    • 122992

    #1

    Help: Re" Need something that will grab two txt files from a url and combine....

    to ONE txt file on a server.....


    How can this be done?
  • EscortDate_Enoj
    Registered User
    • Mar 2002
    • 87

    #2
    Something like this ..

    PHP Code:
    <?php
    
    $url1 = 'http://domain.com/file1.txt';
    $url2 = 'http://doman.com/file2.txt';
    
    $data = '';
    $data.= file_get_contents( $url1 );
    $data.= file_get_contents( $url2 );
    
    $fp = fopen( 'writable_file', 'w' );
    
    if ( !$fp )
         die('Unable to open file for writing');
    
    fwrite( $fp, $data );
    fclose( $data);
    
    echo 'Wrote ' . strlen( $data ) . ' bytes to writable_file';
    
    
    ?>
    Not tested, wrote it just now .. Might contain some syntax errors

    1:287 all November with UnrealBank

    Comment

    • ztik
      Confirmed User
      • Aug 2001
      • 5196

      #3
      whatever script you are using the grab them now you can just double it in the file and it will output one after the other to make a whole list
      .

      Comment

      • juicylinks
        So Fucking Banned
        • Apr 2001
        • 122992

        #4
        Originally posted by EscortDate_Enoj
        Something like this ..

        PHP Code:
        <?php
        
        $url1 = 'http://domain.com/file1.txt';
        $url2 = 'http://doman.com/file2.txt';
        
        $data = '';
        $data.= file_get_contents( $url1 );
        $data.= file_get_contents( $url2 );
        
        $fp = fopen( 'writable_file', 'w' );
        
        if ( !$fp )
             die('Unable to open file for writing');
        
        fwrite( $fp, $data );
        fclose( $data);
        
        echo 'Wrote ' . strlen( $data ) . ' bytes to writable_file';
        
        
        ?>
        Not tested, wrote it just now .. Might contain some syntax errors

        Just tested it it worls but iget this error


        Warning: fclose(): supplied argument is not a valid stream resource in /usr/home/blabla.com/htdocs/grabber.php on line 17

        Comment

        • EscortDate_Enoj
          Registered User
          • Mar 2002
          • 87

          #5
          Originally posted by juicylinks
          Just tested it it worls but iget this error


          Warning: fclose(): supplied argument is not a valid stream resource in /usr/home/blabla.com/htdocs/grabber.php on line 17
          My bad.

          Replace line 17 with

          PHP Code:
          fclose( $fp ); 
          

          1:287 all November with UnrealBank

          Comment

          • spamofon
            Confirmed User
            • Jun 2003
            • 2999

            #6
            if you need a program to merge your proxy files msg me

            Comment

            • juicylinks
              So Fucking Banned
              • Apr 2001
              • 122992

              #7
              Originally posted by spamofon
              if you need a program to merge your proxy files msg me

              hit me up 116999839

              Comment

              Working...