Professional Web Applications Themes

[PHP] Integrating an Applet with PHP - PHP Development

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). doent.EkitDemoForm.TextViewer.value = doent.EkitDemoForm.Ekit.getDoentText(); 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 ...

  1. #1

    Default RE: [PHP] Integrating an Applet with PHP


    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).

    doent.EkitDemoForm.TextViewer.value = doent.EkitDemoForm.Ekit.getDoentText();

    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:toddaristesoftware.com]
    Sent: Thursday, September 11, 2003 3:36 PM
    To: [email]php-generallists.php.net[/email]
    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
    --

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    Warren Vail Guest

  2. #2

    Default Re: [PHP] Integrating an Applet with PHP

    Warren -

    That works...

    [url]http://209.204.172.137/editor/ekit.php[/url]

    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).
    >
    >doent.EkitDemoForm.TextViewer.value = doent.EkitDemoForm.Ekit.getDoentText();
    >
    >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:toddaristesoftware.com]
    >Sent: Thursday, September 11, 2003 3:36 PM
    >To: [email]php-generallists.php.net[/email]
    >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
    >
    >
    --

    Todd Cary Guest

  3. #3

    Default RE: [PHP] Integrating an Applet with PHP

    Again, this is a guess, but it looks like two parameters to the applet are used;

    One called Doent 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=\"DOENT\" 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

    Warren Vail Guest

  4. #4

    Default Re[2]: [PHP] Integrating an Applet with PHP

    Hi,

    Friday, September 12, 2003, 9:38:48 AM, you wrote:
    TC> Warren -

    TC> That works...

    TC> [url]http://209.204.172.137/editor/ekit.php[/url]

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

    TC> Todd



    TC> 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).
    >>
    >>doent.EkitDemoForm.TextViewer.value = doent.EkitDemoForm.Ekit.getDoentText();
    >>
    >>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:toddaristesoftware.com]
    >>Sent: Thursday, September 11, 2003 3:36 PM
    >>To: [email]php-generallists.php.net[/email]
    >>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
    >>
    >>

    What I do in a similar situation is to pass the data in a hidden field
    and then pass that to the java applet. As it is html you will be
    passing you have to use rawurlencode($data) in the php script
    <?
    $data = rawurlencode($data);
    ?>
    In the html part

    <body onload="whatever.applet.Value = unescape(doent.form1.data.value);">
    <form name="form1" action=........>
    <input type="hidden" name="data" value="<? echo $data?>">
    ...


    --
    regards,
    Tom
    Tom Rogers Guest

  5. #5

    Default Re: [PHP] Integrating an Applet with PHP

    mozzilla 1.4. and netscape 7.1 support iframe. Hey the applet looks
    pretty neat is it open source?


    Dan Anderson wrote:
    >>why does it work in IE and not in Netscape 7.1?
    >>
    >>
    >
    >I'm pretty sure ActiveX controls don't run on anything besides MS
    >Windows Lockinware (TM). There are a number of other things that
    >netscape does not fully support (try loading a page with an iframe tag
    >in Netscape). You probably ran into another such problem.
    >
    >-Dan
    >
    >
    >
    --
    Raditha Dissanayake

    ----------------------------------------------------------
    [url]http://www.radinks.com/sftp/?sg[/url]
    Lean and mean secure FTP applet in pure java.
    Complete with Graphical User Inteface Just 150 kb in size.
    Raditha Dissanayake Guest

  6. #6

    Default Re: [PHP] Integrating an Applet with PHP

    Microsoft (being a monopoly) decided it did not want to follow Sun's
    java standard and effectively froze their version of Java available in
    IE Java 2 1.2 . (or something like that -- they're currently
    finishing up Java 2 1.5). So if you wanted to use certain things with
    microsoft you either needed to use ActiveX controls (Microsoft's answer
    to Java) or Java 1.2 functionality (and there is some talk that
    Microsoft will drop all support for Java in its next version of IE).

    So, either (1 of the 3):

    a. You must install Sun's Java Plug In for all computers running your
    program. (If it relies on java > 1.2).
    b. You must use ActiveX controls and forget about non MS Machines --
    or code 2 versions for MS and non MS machines.
    c. The problem is that Base 64 refers to 64 bit machines and no 32 bit
    architecture will support it. (Shouldn't be the case -- Java guarantees
    that different types will be the same number of bytes).

    -Dan

    n Fri, 2003-09-12 at 14:02, Todd Cary wrote:
    > Warren -
    >
    > The Java code is available at [url]http://www.hexidec.com/ekitdemo.php[/url].
    >
    > One of the reasons I need this applet working in non-IE browsers is
    > that my client has staff that use Macs and need to access the site
    > from the field...
    >
    > Todd
    >
    > Vail, Warren wrote:
    > > I'm not sure about the relationship between an applet and an ActiveX control, and most of my development is for IE browsers (they have 90% of the market I hear), so I'm not sure I can help much here. If you can break down what works and what doesn't, it might help.
    > >
    > > If the applet doesn't run correctly, I'd look for some Java release compatibility (maybe where activex comes into play). I think you can update the java release for the NS browser, but you'll have to get each user to do that.
    > >
    > > If, on the other hand, the problem is with the JavaScript, you should be able to conditionally generate working JavaScript for each browser (see PHP get_browser(). You might also enquire about the specs for the editing tool, to see if it supports other methods of encoding the doent.
    > >
    > > Wish I could be of more help here, but I've about reached the end of my chain (knowledge) on this one. I guess it would be too much to ask, but if you have the Java source, most people can sort of read Java, even though they are not proficient with it, and that could tell you a lot.
    > >
    > > I am implementing a site with an Iframe, and having no problems with recent releases of Netscape, older releases are a problem, even with IE.
    > >
    > > I have another site that does WYSIWYG editing in IE and provides a TEXTAREA for those NS users who insist on using stone axes, and it presents one or the other by detecting the browser in php.
    > >
    > > good luck,
    > >
    > > Warren Vail
    > >
    > > -----Original Message-----
    > > From: Dan Anderson [mailto:danmathjunkies.com]
    > > Sent: Friday, September 12, 2003 9:10 AM
    > > To: Todd Cary
    > > Cc: Vail, Warren; PHP List
    > > Subject: Re: [PHP] Integrating an Applet with PHP
    > >
    > >
    > >
    > > > why does it work in IE and not in Netscape 7.1?
    > > >
    > > I'm pretty sure ActiveX controls don't run on anything besides MS
    > > Windows Lockinware (TM). There are a number of other things that
    > > netscape does not fully support (try loading a page with an iframe tag
    > > in Netscape). You probably ran into another such problem.
    > >
    > > -Dan
    > >
    > >
    >
    > --
    >
    Dan Anderson Guest

  7. #7

    Default Re: [PHP] Integrating an Applet with PHP

    Raditha -

    I am using NS 7.1 running in Windows 2000. Which version of Netscape
    are you running?

    This certainly is a strange situation.....

    [url]http://www.hexidec.com/ekitdemo.php[/url]

    No HTML shows in the Editor window on startup with NS; it is there with
    IE.....

    Todd

    Raditha Dissanayake wrote:
    > HI,
    >
    > I tried it on netscape and it works. My jre is 1.4.2. AFAIK this is
    > the only stable jre after 1.3xx series. It's a simple matter to add a
    > line of code to the java applet to do the base64 decoding if you are
    > concerned about compatibility.
    >
    > On the point raised about activex : The default plug in for ie
    > (extremely crappy) is in fact an activex but that does not mean your
    > applet behaves like an activex.
    >
    >
    >
    > Todd Cary wrote:
    >
    >> Dan -
    >>
    >> I am surprised that an Open Source applet would rely on ActiveX. It
    >> appears that there is something I am not doing correctly in setting
    >> the DATA param for Netscape.
    >>
    >> Please overlook my ignorance about browsers and applets as I try to
    >> get a better understanding, but is BASE64 encoding/decoding a feature
    >> of IE and not , possibly, of Netscape?
    >>
    >> Todd
    >>
    >> Dan Anderson wrote:
    >>
    >>>> why does it work in IE and not in Netscape 7.1?
    >>>>
    >>>
    >>>
    >>> I'm pretty sure ActiveX controls don't run on anything besides MS
    >>> Windows Lockinware (TM). There are a number of other things that
    >>> netscape does not fully support (try loading a page with an iframe tag
    >>> in Netscape). You probably ran into another such problem.
    >>>
    >>> -Dan
    >>>
    >>>
    >>>
    >>>
    >>
    >> --
    >
    >
    >
    >
    --
    Todd Cary Guest

  8. #8

    Default Re: [PHP] Integrating an Applet with PHP

    Mozilla 1.4 Red Hat 9.0 KDE 3.2 JRE 1.4.2


    Todd Cary wrote:
    > Raditha -
    >
    > I am using NS 7.1 running in Windows 2000. Which version of Netscape
    > are you running?
    >
    > This certainly is a strange situation.....
    >
    > [url]http://www.hexidec.com/ekitdemo.php[/url]
    >
    > No HTML shows in the Editor window on startup with NS; it is there
    > with IE.....
    >
    > Todd
    >
    > Raditha Dissanayake wrote:
    >
    >> HI,
    >>
    >> I tried it on netscape and it works. My jre is 1.4.2. AFAIK this is
    >> the only stable jre after 1.3xx series. It's a simple matter to add a
    >> line of code to the java applet to do the base64 decoding if you are
    >> concerned about compatibility.
    >>
    >> On the point raised about activex : The default plug in for ie
    >> (extremely crappy) is in fact an activex but that does not mean your
    >> applet behaves like an activex.
    >>
    >>
    >>
    >> Todd Cary wrote:
    >>
    >>> Dan -
    >>>
    >>> I am surprised that an Open Source applet would rely on ActiveX. It
    >>> appears that there is something I am not doing correctly in setting
    >>> the DATA param for Netscape.
    >>>
    >>> Please overlook my ignorance about browsers and applets as I try to
    >>> get a better understanding, but is BASE64 encoding/decoding a
    >>> feature of IE and not , possibly, of Netscape?
    >>>
    >>> Todd
    >>>
    >>> Dan Anderson wrote:
    >>>
    >>>>> why does it work in IE and not in Netscape 7.1?
    >>>>>
    >>>>
    >>>>
    >>>>
    >>>> I'm pretty sure ActiveX controls don't run on anything besides MS
    >>>> Windows Lockinware (TM). There are a number of other things that
    >>>> netscape does not fully support (try loading a page with an iframe tag
    >>>> in Netscape). You probably ran into another such problem.
    >>>>
    >>>> -Dan
    >>>>
    >>>>
    >>>>
    >>>>
    >>>
    >>> --
    >>
    >>
    >>
    >>
    >>
    >

    --
    [url]http://www.radinks.com/upload[/url]
    Drag and Drop File Uploader.
    Raditha Dissanayake Guest

Similar Threads

  1. Resize Applet?
    By Ro-76 in forum Macromedia Shockwave
    Replies: 0
    Last Post: March 23rd, 07:45 AM
  2. Integrating MX and 8.5?
    By Glowkeeper in forum Macromedia Director Basics
    Replies: 1
    Last Post: October 5th, 06:39 PM
  3. Integrating an Applet with PHP
    By Todd Cary in forum PHP Development
    Replies: 0
    Last Post: September 11th, 10:35 PM
  4. AnotherClock Applet
    By Craig McCluskey in forum Linux Setup, Configuration & Administration
    Replies: 1
    Last Post: September 3rd, 02:44 PM
  5. applet in a webform
    By Bobby G in forum ASP.NET General
    Replies: 1
    Last Post: July 23rd, 01:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139