• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 43027
76
  • 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 ]
 
Honk if you love justice! And honk twice for tiny ads!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic