GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Help: Re" Need something that will grab two txt files from a url and combine.... (https://gfy.com/showthread.php?t=380437)

Juicy D. Links 10-31-2004 01:18 PM

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 10-31-2004 01:23 PM

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 :)

ztik 10-31-2004 01:42 PM

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

Juicy D. Links 10-31-2004 01:51 PM

Quote:

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

EscortDate_Enoj 10-31-2004 02:25 PM

Quote:

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 ); 


spamofon 10-31-2004 02:52 PM

if you need a program to merge your proxy files msg me :Graucho

Juicy D. Links 10-31-2004 02:53 PM

Quote:

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

hit me up 116999839


All times are GMT -7. The time now is 03:38 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123