Warren -

Well, your ideas are working like a champ *AND* I am getting a little better idea of how Applets work - "little" mind you!  However, another challenge has emerged: why does it work in IE and not in Netscape 7.1?

The original test script contained this long assignment to the DATA parameter in some sort of "crazy text".  At that time, I did not understand the meaning of "param" nor did I think about BASE64 encoding.  And that is why in IE, the Editor had text in the initial screen - it was assigned encoded text.

So, now the script works with IE but in the Netscape browser the encoded text is not recognized.  Do you have any ideas as to why that may be?  My need for a Java based HTML Editor is so folks at my client's business who have Macs, PCs and Linux based computers can edit HTML based text in a PHP app.

http://209.204.172.137/editor/ekit2.php

Todd

Vail, Warren wrote:
Again, this is a guess, but it looks like two parameters to the applet are used;
 
One called Document and another to indicate that BASE64 encoding was used to encode the html so that the browser doesn't try to render the html into a page.
 
    when you output your form (FROM PHP, of course), somehow include the following among the parameters for the applet;
 
echo "<param NAME=\"DOCUMENT\" VALUE=\"".base64_encode($htmlsource)."\"\n"
    ."<param NAME=\"BASE64\" VALUE=\"true\">\n";
 
odds are against this working(I'm a pessimist), but it is what I would try before moving on.
 
Warren
-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 11, 2003 4:39 PM
To: Vail, Warren; [EMAIL PROTECTED]
Subject: Re: [PHP] Integrating an Applet with PHP

Warren -

That works...

http://209.204.172.137/editor/ekit.php

Now the next challenge is to put the value in $text into the HTML editor with some _javascript_...any suggestions?

Todd
    


Vail, Warren wrote:
There may be other methods, but one that seems to be available from your form will require some _javascript_ code.  Clicking the button located below the applet (onclick event), performs an assignment to the textarea.value (located below the button) the result returned from the applet.gettext() method (actual statement below).

document.EkitDemoForm.TextViewer.value = document.EkitDemoForm.Ekit.getDocumentText();

I would suspect you could to this assignment to a hidden html field and then do a form submit to pass the "hidden" value to your php program on your server.  Don't forget to have your form action field invoke your php program and with method=post you could retrieve the value as below; 

$htmltext = $_POST["hiddenfld"];

hope this helps,

Warren Vail


-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 11, 2003 3:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Integrating an Applet with PHP


I have located an HTML editor written in Java that works with my clients 
various computers (e.g. Linux, PC and Macs).  What I need to do is learn 
how to take the output from an Applet and put it into a PHP variable.  
Since I have no experience with Java, I am at a disadvantage, so if 
someone could point me toward some literature that explains this or if 
someone already has the experience and can look at the source and tell 
me how, it would be greatly appreciated.

http://209.204.172.137/editor/ekit.php

Todd
  

--

--

<<inline: NewLogo.gif>>

Reply via email to