Re: Using PHP and JAVA applets together [message #178714 is a reply to message #178706] |
Mon, 23 July 2012 10:08 |
Erwin Moller
Messages: 228 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 7/21/2012 5:09 AM, K.J.Williams wrote:
> I wanted to know if you can design a method for a JAVA applet to send data to
> a PHP server and vice versa (PHP server sends data to the JAVA applet) on the internet, so that either program does something different based on what the data is?
>
> Thanks
>
Your question is framed in such a way that I get the impression you are
not sure what (Java applet/PHP) runs where.
"so that either program does something different based on what the data
is" <-- that is vague.
To clarify:
An applet runs in the browser (client).
An applet can request ANY data from ANY server. If you use the same
domain where the applet is hosted, things will be easier to set up for you.
So if your applet is hosted here:
http://www.example.com/yourpage.php
and the HTML coming from there embeds an applet, that applet can easily
reach to www.example.com, but not to www.anotherexample.com.
It needs additional rights for that (possibly this includes 'signing'
the applet.)
Ask in a java newsgroup for details. It has been years ago since I
programmed Applet <--> PHP communication, so better ask the experts.
And PHP ALWAYS runs on the server. It will never run at the client
(browser). PHP produces the HTML (or images, or whatever) that is sent
to the browser.
So as far as the browser is concerned, it could all be static HTML as well.
Hope this helps you approaching your puzzle. :-)
Regards,
Erwin Moller
--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
|
|
|