Works for me!
I don't think PHP is the problem.
I first tried this with PHP as cgi and it worked fine, then retested
with PHP as module and still worked fine.

Platform;
NT4 SP6
Server Version: Apache/1.3.19(Win32) mod_jk PHP/4.0.4pl1 DAV/1.0.2

applet code;
======================8<================================
package testrd;

import java.applet.*;
import java.io.*;
import java.net.*;

public class Applet1 extends Applet {

  public Applet1() {
  }

  public void init() {
    try {

      String line;
      URL u=new URL("http://192.168.0.22/tst.phpm");
      URLConnection uc=u.openConnection();
      DataInputStream d=new DataInputStream(uc.getInputStream());
      while ( (line=d.readLine()) != null ) {
        System.out.println(line);
      }
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
}
======================8<================================

tst.php;
======================8<================================
<?php
   print "some module text ...\n";
   print "some more text ...\n";
?>
======================8<================================



> -----Original Message-----
> From: Peter Choynowski [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 4 April 2001 10:09
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Java applet can't read PHP output !!
>
>
>
> I have tried putting \n and a header command with no help.
> My current
> theory is that php is manipulating the socket options in some way,
> making Java drop the connection ( since Perl or sh CGI
> script works with
> the same Java code).  I have tried to modify the applet to use read
> method in place of readLine with the same results - it
> reads fine from
> Perl or SH but not from PHP - I have written a large quantity of PHP
> code and want to stick to using only PHP ( makes support
> easier ).  My
> last option is running a tcpdump on the connection and see what is
> flowing on the cable and look for differences, or looking
> through code
> and trying to find the php - apache interface code  :-(
>
> Bye,
> Peter
>
>
> --
> 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]

Reply via email to