Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: java applet to php server communication

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java applet to php server communication

    Hello everyone
    I have an japplet. I want to do the following with this applet
    Whenever a user click on a button i want to pass a variable to a php server. the server will check this value with the stored value in database if true return true if false return false.
    Now based on this return value japplet will do something if the return value is false ask the user to enter value again and the same process continue if return value is true then upload a file stored on local disk to another php server that will enter it into mysql database and if successfully uploaded return true else false simultaneously I want to pass variables like filename filesize file extension etc to first server.
    My problem is how to communicate between java applet and php server. I can write php code as well as java code like click event, calculate filename filesize etc etc.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java applet to php server communication

    What protocol will the server support? HTTP for example? Or are you going to design your own?
    Will the server open a socket that the applet connects to?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java applet to php server communication

    Quote Originally Posted by Norm View Post
    What protocol will the server support? HTTP for example? Or are you going to design your own?
    Will the server open a socket that the applet connects to?
    The server will support only http protocol and yes I can open php socket connection on both the servers.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java applet to php server communication

    How will you use the HTTP protocol for the communications between applet and server?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java applet to php server communication

    I think POST method would be appropriate.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java applet to php server communication

    That should work.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java applet to php server communication

    I know the post method would work but how to do it.

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java applet to php server communication

    Have you asked google how to code a POST in java?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Applet-Server Communication
    By bgroenks96 in forum Java Applets
    Replies: 7
    Last Post: September 12th, 2011, 08:48 PM
  2. Method :sending image java server to php client
    By ashi123 in forum Java Theory & Questions
    Replies: 0
    Last Post: July 22nd, 2011, 10:15 AM
  3. server/client communication problem
    By perl0101 in forum Java Networking
    Replies: 8
    Last Post: May 24th, 2011, 01:58 PM
  4. client server communication
    By Brt93yoda in forum Java Theory & Questions
    Replies: 4
    Last Post: September 2nd, 2010, 04:49 PM
  5. servlet applet communication
    By prashanthi_asn in forum Java Servlet
    Replies: 0
    Last Post: May 21st, 2009, 12:50 AM

Tags for this Thread