Calling java program from PHP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Gelder

    Calling java program from PHP?

    Hi, I'm new to PHP but learning fast. I'm already a Java programmer and
    was wondering if there is a way to have a PHP script pass parameters to
    a Java program and put the data back into the page.

    Thanks In Advance
    Merry Christmas
    Dan

  • Iván Sánchez Ortega

    #2
    Re: Calling java program from PHP?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Dan Gelder wrote:
    [color=blue]
    > Hi, I'm new to PHP but learning fast. I'm already a Java programmer and
    > was wondering if there is a way to have a PHP script pass parameters to
    > a Java program and put the data back into the page.[/color]

    Try something like:

    <?php

    $parameter1='fo o';
    $parameter2='ba r';
    $parameter3='qu ux';

    $output = shell_exec("jav a whatever.jar $parameter1 $parameter2
    $parameter3");

    echo $output;

    ?>


    - --
    - ----------------------------------
    Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

    Lo que importa es cuanto amor ponemos en el trabajo que realizamos.
    -- Madre Teresa de Calcuta. (1910-1997) Misionera yugoslava
    nacionalizada india.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQFDrgD23jc Q2mg3Pc8RAn1gAJ wPTpcY0Y4fEACEU WxGhpdtJ+FIwACc Ckvy
    Qg0x2pfpquyz0T0 gj7nPn8g=
    =YHtJ
    -----END PGP SIGNATURE-----

    Comment

    Working...