This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Applet to PHP

 
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
 
Rancher
Posts: 43016
76
  • 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 ]
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic