In article <83**************************@posting.google.com >, Georg Andersson wrote:
Hi
i'm having a little problem of understanding some differences between
Java and PHP.
Well, PHP runs on the server. so, if my script saves some data from a
database to 'c:\temp', it saves the data to the local disc of the
server itself. correct? but java runs on the client-side. this means
the my applet trying to save data from a database to 'c:\temp' saves
the data to the local disc of the client... am i right?
so, is it possible to either save data to the clients disc using a
php-script or save data to the servers local disc using a
java-applet??
any ideas?
I think the source of your confusion is server-side vs client-side. It's
really a matter of perspective, both can run server side or client side.
It kind of depends on where and how it's deployed, if it is actually
deployed on the server, then that is where it "runs". (This doesn't
count software placed on a server for download)
A jar file or other program stored on the server, or in some way
downloaded by the client for execution, then it is run "client side".
javascript is typical for "client side" execution. You can even have
several server-side applications that fetch code from other servers to
be run.
As far as browser based "applets" (the way most people knowingly
come into contact with java) it is run client side, within the browser.
Java supports security policies, these can control whether or not files can
be saved (or read) client side. Otherwise it would be major security
hole. So, saving to "C:\temp" may not work for browser based java
*applets*
The language itself is irrelevant.
In theory you could download a web application (JSP files and servlets
packet into a .war) bundled with a servlet implementation that is run
client side, to stretch things out a bit.. the sevlet implementation may
have support for PHP in which case you've got "server code" running "client
side". :-)
Jamie
--
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX