Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to PHP

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm looking to update a MySql database from an applet.
The 2 roots I was thinking were:
Applet->php->database
Applet->servlet->database

But my webhost doesn't allow servlets/jsp, so I would like to try the php root.
I've looked on the internet, but I can't find anything concrete to use, just lots of random waffle.

Essentially I just want to pass a String from my applet to a .php page on the server (Or a function from a php page), possibly by retrieving the String like a Form parameter on an html page.

Can anyone help?
Thanks
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Essentially I just want to pass a String from my applet to a .php page on the server (Or a function from a php page), possibly by retrieving the String like a Form parameter on an html page.


Depending on how the applet/PHP interaction should work I see two ways to do this. Either the applet just accesses the PHP URL with the parameters and reads a response which it can make sense of. The java.net.URL class and its openStream method can do that (the URL can contain GET parameters).

Or the page containing the applet gets replaced by a web page generated on the server; again, the URL could contain parameters. For this you'd use java.applet.Applet.getAppletContext, and then AppletContext.showDocument.
[ October 26, 2007: Message edited by: Ulf Dittmer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic