• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Possible to call PHP webpage from Applet?

 
Matt Wil
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to pass values from my Applet to a PHP script on a web server. The script will take the values and insert them into a mySQL database. Are there any tutorials on how to call a PHP page and pass values to it? Will a web browser open when this happens(i would prefer it not).
Thanks,
Matt
 
Joe Ess
Bartender
Posts: 9337
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't matter how the resource is implemented, you can obtain the contents of it using either java.net.URL or java.net.URLConnection
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as the applet is on the same server as the PHP you are ok. Applets by default can't connect to machiens other than the one they are served from so if the machine with the PHP page is on a different server, then you will have ot sign your applet to allow it to make the connection.

brian
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP is completely ignorance of what programming language(s) are being used on the server - all it cares about is that the protocol itself is being followed.

So there is no detectable difference between communicating with a J2EE server vs. a PHP server vs. and ASP server, and so forth. Well, actually there is, since different sets of auxiliary headers may be sent, but for your purposes, that doesn't matter.

The sandbox rule about only being able to talk back to the server your applet loaded from (unless it's signed and authorized) applies regardless of the language and brand of server involved.

And, yes, you can store applet class and jar files on a PHP server and have it download them to the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic