Designing Java applets to work with PHP server scripts

Discussion in 'Java' started by K.J. Williams, Jul 10, 2012.

  1. I want to know, in general, how easy is it to design a Java applet to work with PHP for use on the internet?

    thanks
     
    K.J. Williams, Jul 10, 2012
    #1
    1. Advertising

  2. K.J. Williams

    Arne Vajhøj Guest

    On 7/10/2012 6:42 PM, K.J. Williams wrote:
    > I want to know, in general, how easy is it to design a Java applet to work with PHP for use on the internet?


    Rather easy.

    Applet with builtin (Http)URLConnection or Apache HttpClient or
    another HTTP client lib and a PHP script returning XML/JSON/CSV
    is very simple to implement.

    Arne
     
    Arne Vajhøj, Jul 11, 2012
    #2
    1. Advertising

  3. K.J. Williams

    Roedy Green Guest

    On Tue, 10 Jul 2012 15:42:44 -0700 (PDT), "K.J. Williams"
    <> wrote, quoted or indirectly quoted
    someone who said :

    >I want to know, in general, how easy is it to design a Java applet to work with PHP for use on the internet?


    They have nothing to do with each other. You trigger an Applet with
    ordinary HTML. You don't have to dynamically generate anything.

    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    Mathematicians and computer scientists are far more interested
    in impressing you than informing you. If this were not
    so, the tutorials on building a robots.txt file, for example,
    would consist primarily of an annotated example. What you get
    instead are nothing but inscrutable adstract fragments in some
    obscure dialect of BNF.
     
    Roedy Green, Jul 12, 2012
    #3
  4. K.J. Williams

    Nigel Wade Guest

    On 10/07/12 23:42, K.J. Williams wrote:
    > I want to know, in general, how easy is it to design a Java applet to work with PHP for use on the internet?
    >


    You need to be more explicit. Java applets are normally delivered from a
    web server, and run client-side. PHP is a general purpose scripting
    language which happens to be used on some web servers for CGI and other
    server-side operations.

    In what do you want an applet to "work with" PHP?

    --
    Nigel Wade
     
    Nigel Wade, Jul 12, 2012
    #4
  5. K.J. Williams

    Roedy Green Guest

    On Thu, 12 Jul 2012 14:58:56 +0100, Nigel Wade <>
    wrote, quoted or indirectly quoted someone who said :

    >In what do you want an applet to "work with" PHP?


    Maybe you mean have the applet send in transactions that look like CGI
    forms?
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    Mathematicians and computer scientists are far more interested
    in impressing you than informing you. If this were not
    so, the tutorials on building a robots.txt file, for example,
    would consist primarily of an annotated example. What you get
    instead are nothing but inscrutable adstract fragments in some
    obscure dialect of BNF.
     
    Roedy Green, Jul 13, 2012
    #5
  6. K.J. Williams

    Arne Vajhøj Guest

    On 7/12/2012 9:58 AM, Nigel Wade wrote:
    > On 10/07/12 23:42, K.J. Williams wrote:
    >> I want to know, in general, how easy is it to design a Java applet to
    >> work with PHP for use on the internet?

    >
    > You need to be more explicit. Java applets are normally delivered from a
    > web server, and run client-side. PHP is a general purpose scripting
    > language which happens to be used on some web servers for CGI and other
    > server-side operations.
    >
    > In what do you want an applet to "work with" PHP?


    Having an applet communicate with a web service is rather common.

    Arne
     
    Arne Vajhøj, Jul 24, 2012
    #6
  7. K.J. Williams

    Arne Vajhøj Guest

    On 7/13/2012 1:07 AM, Roedy Green wrote:
    > On Thu, 12 Jul 2012 14:58:56 +0100, Nigel Wade <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> In what do you want an applet to "work with" PHP?

    >
    > Maybe you mean have the applet send in transactions that look like CGI
    > forms?


    Forms are defined in the HTML standard not in the CGI standard.

    Arne
     
    Arne Vajhøj, Jul 24, 2012
    #7
  8. K.J. Williams

    Nigel Wade Guest

    On 24/07/12 02:33, Arne Vajhøj wrote:
    > On 7/12/2012 9:58 AM, Nigel Wade wrote:
    >> On 10/07/12 23:42, K.J. Williams wrote:
    >>> I want to know, in general, how easy is it to design a Java applet to
    >>> work with PHP for use on the internet?

    >>
    >> You need to be more explicit. Java applets are normally delivered from a
    >> web server, and run client-side. PHP is a general purpose scripting
    >> language which happens to be used on some web servers for CGI and other
    >> server-side operations.
    >>
    >> In what do you want an applet to "work with" PHP?

    >
    > Having an applet communicate with a web service is rather common.
    >


    I know it is, but that is just one rather specific instance of "server
    scripts".

    --
    Nigel Wade
     
    Nigel Wade, Jul 24, 2012
    #8
  9. K.J. Williams

    Arne Vajhøj Guest

    On 7/24/2012 6:59 AM, Nigel Wade wrote:
    > On 24/07/12 02:33, Arne Vajhøj wrote:
    >> On 7/12/2012 9:58 AM, Nigel Wade wrote:
    >>> On 10/07/12 23:42, K.J. Williams wrote:
    >>>> I want to know, in general, how easy is it to design a Java applet to
    >>>> work with PHP for use on the internet?
    >>>
    >>> You need to be more explicit. Java applets are normally delivered from a
    >>> web server, and run client-side. PHP is a general purpose scripting
    >>> language which happens to be used on some web servers for CGI and other
    >>> server-side operations.
    >>>
    >>> In what do you want an applet to "work with" PHP?

    >>
    >> Having an applet communicate with a web service is rather common.

    >
    > I know it is, but that is just one rather specific instance of "server
    > scripts".


    But in the context of "Java applet to work with PHP" it is a pretty good
    fit.

    Arne
     
    Arne Vajhøj, Jul 24, 2012
    #9
  10. K.J. Williams

    Nigel Wade Guest

    On 24/07/12 20:51, Arne Vajhøj wrote:

    >
    > But in the context of "Java applet to work with PHP" it is a pretty good
    > fit.
    >


    I would think CGI is a far more common fit than web service. But it
    would still be an assumption which may mean wasting time providing
    advice on heading down blind alleys. Better to get a more definitive
    context from the OP first (which has still not been provided).

    --
    Nigel Wade
     
    Nigel Wade, Jul 25, 2012
    #10
  11. K.J. Williams

    Arne Vajhøj Guest

    On 7/25/2012 4:48 AM, Nigel Wade wrote:
    > On 24/07/12 20:51, Arne Vajhøj wrote:
    >> But in the context of "Java applet to work with PHP" it is a pretty good
    >> fit.

    >
    > I would think CGI is a far more common fit than web service.


    I can not see where CGI fits in.

    Running PHP via CGI instead of FastCGI or Apache module is
    not related to applets.

    Arne
     
    Arne Vajhøj, Jul 25, 2012
    #11
  12. K.J. Williams

    Nigel Wade Guest

    On 25/07/12 16:17, Arne Vajhøj wrote:
    > On 7/25/2012 4:48 AM, Nigel Wade wrote:
    >> On 24/07/12 20:51, Arne Vajhøj wrote:
    >>> But in the context of "Java applet to work with PHP" it is a pretty good
    >>> fit.

    >>
    >> I would think CGI is a far more common fit than web service.

    >
    > I can not see where CGI fits in.
    >
    > Running PHP via CGI instead of FastCGI or Apache module is
    > not related to applets.


    What?

    --
    Nigel Wade
     
    Nigel Wade, Jul 25, 2012
    #12
  13. K.J. Williams

    Arne Vajhøj Guest

    On 7/25/2012 11:20 AM, Nigel Wade wrote:
    > On 25/07/12 16:17, Arne Vajhøj wrote:
    >> On 7/25/2012 4:48 AM, Nigel Wade wrote:
    >>> On 24/07/12 20:51, Arne Vajhøj wrote:
    >>>> But in the context of "Java applet to work with PHP" it is a pretty
    >>>> good
    >>>> fit.
    >>>
    >>> I would think CGI is a far more common fit than web service.

    >>
    >> I can not see where CGI fits in.
    >>
    >> Running PHP via CGI instead of FastCGI or Apache module is
    >> not related to applets.

    >
    > What?


    I don't understand where CGI comes in.

    We know we have applet and PHP.

    Where does CGI get involved?

    Arne
     
    Arne Vajhøj, Jul 25, 2012
    #13
  14. K.J. Williams

    Nigel Wade Guest

    On 25/07/12 16:26, Arne Vajhøj wrote:
    > On 7/25/2012 11:20 AM, Nigel Wade wrote:
    >> On 25/07/12 16:17, Arne Vajhøj wrote:
    >>> On 7/25/2012 4:48 AM, Nigel Wade wrote:
    >>>> On 24/07/12 20:51, Arne Vajhøj wrote:
    >>>>> But in the context of "Java applet to work with PHP" it is a pretty
    >>>>> good
    >>>>> fit.
    >>>>
    >>>> I would think CGI is a far more common fit than web service.
    >>>
    >>> I can not see where CGI fits in.
    >>>
    >>> Running PHP via CGI instead of FastCGI or Apache module is
    >>> not related to applets.

    >>
    >> What?

    >
    > I don't understand where CGI comes in.
    >
    > We know we have applet and PHP.
    >
    > Where does CGI get involved?
    >


    If you use the applet to communicate with a CGI PHP script.

    --
    Nigel Wade
     
    Nigel Wade, Jul 26, 2012
    #14
  15. K.J. Williams

    Arne Vajhøj Guest

    On 7/26/2012 4:25 AM, Nigel Wade wrote:
    > On 25/07/12 16:26, Arne Vajhøj wrote:
    >> On 7/25/2012 11:20 AM, Nigel Wade wrote:
    >>> On 25/07/12 16:17, Arne Vajhøj wrote:
    >>>> On 7/25/2012 4:48 AM, Nigel Wade wrote:
    >>>>> On 24/07/12 20:51, Arne Vajhøj wrote:
    >>>>>> But in the context of "Java applet to work with PHP" it is a pretty
    >>>>>> good
    >>>>>> fit.
    >>>>>
    >>>>> I would think CGI is a far more common fit than web service.
    >>>>
    >>>> I can not see where CGI fits in.
    >>>>
    >>>> Running PHP via CGI instead of FastCGI or Apache module is
    >>>> not related to applets.
    >>>
    >>> What?

    >>
    >> I don't understand where CGI comes in.
    >>
    >> We know we have applet and PHP.
    >>
    >> Where does CGI get involved?

    >
    > If you use the applet to communicate with a CGI PHP script.


    I still don't get it.

    CGI is a protocol used between web servers and scripts/scriptengines.

    You can do:

    applet----(HTTP)----web server----(CGI)----PHP

    or:

    applet----(HTTP)----web server----(something else than CGI)----PHP

    But whether PHP is integrated via CGI or FastCGI or Apache module
    (in process call) does not impact how the PHP code looks and not
    how the Java applet code look like - it is purely a server
    configuration issue.

    I don't think the original poster is asking on how to integrated PHP
    with his web server.

    Arne
     
    Arne Vajhøj, Jul 26, 2012
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GT
    Replies:
    19
    Views:
    693
    petersprc
    May 25, 2008
  2. raviraj joshi
    Replies:
    0
    Views:
    342
    raviraj joshi
    Jul 4, 2009
  3. reshma shinde
    Replies:
    0
    Views:
    419
    reshma shinde
    Jul 4, 2009
  4. Rajive Narain
    Replies:
    0
    Views:
    1,989
    Rajive Narain
    Sep 18, 2009
  5. raviraj joshi
    Replies:
    0
    Views:
    176
    raviraj joshi
    Jul 4, 2009
Loading...

Share This Page