• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet to PHP

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic