Results 1 to 13 of 13
  1. #1

    Combining php and java variables?

    Is it possiable to use java variables with php? I don't really know java, but there are some things that I really want to do with both java and php, where php is receveiving the java variable...

  2. #2
    I don't think it's directly possible. Although you can make some workarounds, such as passing your variables between Java and PHP applications via querystring (i.e. ?variable1=1&variable2=2).

  3. #3
    Join Date
    Dec 2002
    NY, NY
    Why not just do it in one language?
    And what It-spot is saying is right.

    lets say you need to go from java to php
    form action ="fgfdg.php"
    php file
    receive variables

    and vice versa

  4. #4
    It's realy unitelligible/stange needs. You can create java object on the fly in php, or in java use php as external programm, but my opinion any task have solution in both languages and it will be more stable. Can you explain what do on php+java ?
    From Adult Web Hosting Service with love

  5. #5
    Join Date
    Feb 2004

    Yes you can,You can refer the following sites to get the info about using Java objects in PHP scripts.


    24 / 7 Technical Support
    Bright Info Solutions

  6. #6
    If for example I wanted to get the visitors screen resolution, I could go about doing that by how? (if I were to write the data to a .txt file)

  7. #7
    If you are talking about getting the screen resolution from a users web browser, you can do this via javascript. Just have the script set some form variables that get passed into either you java or php server script

    Check out javascripts screen object. Specifically screen.width and screen.height.

    <A HREF="javascript:alert('Your resolution is '+screen.width+'x'+screen.height);">
    Click for your screen resolution</A>
    Rodney McCabe
    Vestals Gap Consulting, LLC

  8. #8
    I know how to do that javascript part, but I'm not understanding how to get that data, and with php, write it to a file (.txt).

    I know also how to write to files, but the problem is how to store the width and height into a variable, so the php script can write...

  9. #9
    Join Date
    May 2004
    It's in the official php docs:

    Be sure to read the wiki comments as well.

  10. #10
    Join Date
    Jun 2003

  11. #11
    I knew there was a difference, but I just didn't know what it was (java and javascript), so I always ignored that fact.

    And I think I get the php/java (or javascript...ya...)

  12. #12
    Join Date
    Dec 2002
    NY, NY
    You my friend have been fooled.
    Let me edumacate you.

    Ok ..
    Java was made by sun.
    Javascript was made by netscape [after Java was made]

    Javascript was originally called "Livesoft"
    they changed it to Javascript, because Java was gaining popularity, and livesoft wanted some of the action.
    It is really dissapointing to hear people use Java to talk about Javascript.
    Javascript is not a real language per say.. it is like html.
    Very limited...
    You cannot really make stand-alone apps and the like..

    With Java you can do anything that you can do with php and then some.

    Hope that cleared it up.

  13. #13
    K, i get it now. and couldn't you say for java "Java Script" as when you are refering to java, (notice it has a space... to signify that it is not a whole name)

    And I also get the php/java now, and I have my outcome here:

Posting Permissions

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