Hi,
I'm trying to use a php script to save a file but the's no way to see it work invoked by an applet
The php script works correctly if invoked via html
Here follows the java and php code.

---java---------
import java.applet.Applet;
import java.awt.*;
import java.net.*;
import java.io.*;
import java.io.Writer;


public class wFile1 extends Applet{
public String str;

public void init(){


}//init


public void paint(Graphics g){
boolean b = true;

g.drawString("Start paint",1,10);
b=Writ_e("What_File_Contains");
g.drawString(str,1,20);
if (b == true)
g.drawString("Ok",1,30);
else
g.drawString("Fail",1,30);
}//paint

public boolean Writ_e(String varFileContent)
{
boolean log = false;
try
{
String params = URLEncoder.encode ("FileContent", "UTF-8") + "=" +
URLEncoder.encode (varFileContent, "UTF-8");

URL url = new URL ("http://127.0.0.1/wFile1.php");

URLConnection conn = url.openConnection();

conn.setDoOutput(true);

OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream());

out.write(params);
str = params;
log = true;
}//try
catch (IOException a)
{
System.out.println("Error URL 2");
}//catch

return log;
}//Writ_e

}//wFile1
---php----------

<html>
<body>
<?php
$FileContent = $_POST['FileContent'];


$fn = "wFile1.txt";

$fp = fopen($fn,"w");
flock($fp,2);
fputs($fp,$FileContent);
flock($fp,3);
fclose($fp);

/*verify*/
$fn = "wFile2.txt";
/* writes a verify file */
$fp = fopen($fn,"w");
flock($fp,2);
fputs($fp,"verify");
flock($fp,3);
fclose($fp);

?>
</body>

</html>


someone can help me please?

Thank you very much