Re: [PHP] How to catch the output of http:// - text file?

2001-05-05 Thread Alexander Skwar

So sprach elias am Wed, May 02, 2001 at 04:28:41PM -0700:
$lines = join('', file(http://www.mysite.com/generator.php?id=$i));

Easier:

$lines = readfile('URL...');

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 21 hours 0 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to catch the output of http:// - text file?

2001-05-05 Thread Alexander Skwar

So sprach Kraa de Simon am Thu, May 03, 2001 at 10:19:49AM +0200:
 Warning: Bad arguments to join() in c:\program
 files\nusphere\apache\htdocs\test.php on line 2

See http://php.net/join and you'll see the error.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 21 hours 2 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to catch the output of http:// - text file?

2001-05-05 Thread Alexander Skwar

So sprach Kraa de Simon am Thu, May 03, 2001 at 10:32:47AM +0200:
 I'm on Windows 2000, Apache 1.3.12 / PHP 4.0.4pl1 and MySQL 3.23.32.

Fine - so?

PS: No fullquotes, please...

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 21 hours 2 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to catch the output of http:// - text file?

2001-05-05 Thread Alexander Skwar

So sprach Kraa de Simon am Thu, May 03, 2001 at 11:05:08AM +0200:
 Could it have something to do with the fact that the webserver is behind a
 firewall/proxy or something?
 
 When I enter the http addres in the browser everything works fine...

I think the issue is, that PHP is not HTTP/1.1 compliant, meaning, it won't
follow redirects.  IIRC the URL you entered (http://www.ansilion.com) is
technically wrong.  Either try it with http://www.ansilion.com/ or with a
fully qualified URL which also gives the file name on the server, ie.
http://www.ansilion.com/index.html and see if this works.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 21 hours 3 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to catch the output of http:// - text file?

2001-05-03 Thread Kraa de Simon

Thanks,

When I try:


?
$lines = join('', file(http://www.ansilion.com;));
echo $lines;
?


I get the following error:


Warning: file(http://www.ansilion.com;) - No error in c:\program
files\nusphere\apache\htdocs\test.php on line 2

Warning: Bad arguments to join() in c:\program
files\nusphere\apache\htdocs\test.php on line 2


Huh!?!?!

Simon.

 -Original Message-
 From: elias [mailto:[EMAIL PROTECTED]]
 Sent: donderdag 3 mei 2001 1:29
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] How to catch the output of http:// - text file?
 
 
 Never tried what i'll write you, but it should work though!
 
 for ($i=0;$i2000;$i++)
 {
$lines = join('', file(http://www.mysite.com/generator.php?id=$i));
   // save $lines to a file.
 }
 
 -elias
 http://eassoft.cjb.net
 
 Kraa de Simon [EMAIL PROTECTED] wrote in message
 C1EBEEBBB842D411B412949A1F5875867A@wwmessd135">news:C1EBEEBBB842D411B412949A1F5875867A@wwmessd135...
  Hi,
 
  PHP newbie.
 
  Can anyone help me with the following?
 
  Pseudo code:
 
  for(i=1;i2000;i++)
  {
  catch the output of
  http://www.mysite.com/kb.html?kbid= ? echo i ?
  and put the html code in a text file called
  /www/kb/kbid ? echo i ? .html
  }
 
  So the end result is 2000 html files on disk extacted 
 from the http://
  address...
 
  Thanks...
 
  Met vriendelijke groet / With kind regards,
 
  Simon de Kraa
  ICL Logistic Systems
  mailto:[EMAIL PROTECTED]
 
  ---
 
  Microsoft Windows 2000 Professional SP 1, Progress 9.1b, 
 Roundtable 9.1b
  SCO UnixWare 7.1.1, Progress 9.1a11
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to catch the output of http:// - text file?

2001-05-03 Thread Kraa de Simon

I'm on Windows 2000, Apache 1.3.12 / PHP 4.0.4pl1 and MySQL 3.23.32.

 -Original Message-
 From: Kraa de Simon [mailto:[EMAIL PROTECTED]]
 Sent: donderdag 3 mei 2001 10:20
 To: 'elias'; [EMAIL PROTECTED]
 Subject: RE: [PHP] How to catch the output of http:// - text file?
 
 
 Thanks,
 
 When I try:
 
 
 ?
   $lines = join('', file(http://www.ansilion.com;));
   echo $lines;
 ?
 
 
 I get the following error:
 
 
 Warning: file(http://www.ansilion.com;) - No error in c:\program
 files\nusphere\apache\htdocs\test.php on line 2
 
 Warning: Bad arguments to join() in c:\program
 files\nusphere\apache\htdocs\test.php on line 2
 
 
 Huh!?!?!
 
 Simon.
 
  -Original Message-
  From: elias [mailto:[EMAIL PROTECTED]]
  Sent: donderdag 3 mei 2001 1:29
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] How to catch the output of http:// - text file?
  
  
  Never tried what i'll write you, but it should work though!
  
  for ($i=0;$i2000;$i++)
  {
 $lines = join('', 
 file(http://www.mysite.com/generator.php?id=$i));
// save $lines to a file.
  }
  
  -elias
  http://eassoft.cjb.net
  
  Kraa de Simon [EMAIL PROTECTED] wrote in message
  C1EBEEBBB842D411B412949A1F5875867A@wwmessd135">news:C1EBEEBBB842D411B412949A1F5875867A@wwmessd135...
   Hi,
  
   PHP newbie.
  
   Can anyone help me with the following?
  
   Pseudo code:
  
   for(i=1;i2000;i++)
   {
   catch the output of
   http://www.mysite.com/kb.html?kbid= ? echo i ?
   and put the html code in a text file called
   /www/kb/kbid ? echo i ? .html
   }
  
   So the end result is 2000 html files on disk extacted 
  from the http://
   address...
  
   Thanks...
  
   Met vriendelijke groet / With kind regards,
  
   Simon de Kraa
   ICL Logistic Systems
   mailto:[EMAIL PROTECTED]
  
   ---
  
   Microsoft Windows 2000 Professional SP 1, Progress 9.1b, 
  Roundtable 9.1b
   SCO UnixWare 7.1.1, Progress 9.1a11
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: 
  [EMAIL PROTECTED]
  
  
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: 
  [EMAIL PROTECTED]
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to catch the output of http:// - text file?

2001-05-03 Thread Wieger Uffink

Hi Simon,

Try the following for reading the files,

for(i=1;i2000;i++) {

$response=;
$request=kbid=$i;
//Header
$header =  POST kb.html HTTP/1.0\r\n;
$header .= Content-type: application/x-www-form-urlencoded\r\n;
$header .= Content-length:  . strlen($request) . \r\n\r\n;

//Open Connection
$fp = fsockopen(www.mysite.com,80,$err_num,$err_msg, 30);
if($fp) {
fputs($fp, $header.$request);
while(!feof($fp))
$response .= fgets($fp,2048);
fclose($fp);
}
else {
if(DEBUG) {
echo ERR_NUM: $err_num\nERR_MSG: $err_msg;
}
//write response to a file
echo $response;
}

Hope this helps you,

Wieger


Kraa de Simon wrote:
 
 Hi,
 
 PHP newbie.
 
 Can anyone help me with the following?
 
 Pseudo code:
 
 for(i=1;i2000;i++)
 {
 catch the output of
 http://www.mysite.com/kb.html?kbid= ? echo i ?
 and put the html code in a text file called
 /www/kb/kbid ? echo i ? .html
 }
 
 So the end result is 2000 html files on disk extacted from the http://
 address...
 
 Thanks...
 
 Met vriendelijke groet / With kind regards,
 
 Simon de Kraa
 ICL Logistic Systems
 mailto:[EMAIL PROTECTED]
 
 ---
 
 Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1b
 SCO UnixWare 7.1.1, Progress 9.1a11
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Wieger Uffink
tel: +31 20 428 6868
fax: +31 20 470 6905
web: http://www.usmedia.nl

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to catch the output of http:// - text file?

2001-05-02 Thread elias

Never tried what i'll write you, but it should work though!

for ($i=0;$i2000;$i++)
{
   $lines = join('', file(http://www.mysite.com/generator.php?id=$i));
  // save $lines to a file.
}

-elias
http://eassoft.cjb.net

Kraa de Simon [EMAIL PROTECTED] wrote in message
C1EBEEBBB842D411B412949A1F5875867A@wwmessd135">news:C1EBEEBBB842D411B412949A1F5875867A@wwmessd135...
 Hi,

 PHP newbie.

 Can anyone help me with the following?

 Pseudo code:

 for(i=1;i2000;i++)
 {
 catch the output of
 http://www.mysite.com/kb.html?kbid= ? echo i ?
 and put the html code in a text file called
 /www/kb/kbid ? echo i ? .html
 }

 So the end result is 2000 html files on disk extacted from the http://
 address...

 Thanks...

 Met vriendelijke groet / With kind regards,

 Simon de Kraa
 ICL Logistic Systems
 mailto:[EMAIL PROTECTED]

 ---

 Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1b
 SCO UnixWare 7.1.1, Progress 9.1a11

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]