RE: [PHP] Java applet can't read PHP output !!
| From: | Andrew Braund | Date: | Wed, 04 Apr 2001 02:09:12 +0000 |
| Subject: | RE: [PHP] Java applet can't read PHP output !! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46944@lists.php.net to get a copy of this message | ||
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:pkc@scs.carleton.nospam.ca]
> Sent: Wednesday, 4 April 2001 10:09
> To: php-general@lists.php.net
> 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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>