By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,797 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,797 IT Pros & Developers. It's quick & easy.

Java and PHP

P: n/a
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?

tx
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Georg Andersson" <ge*************@swisstopo.ch> wrote in message
news:83**************************@posting.google.c om...
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.


Java can run either on the client or the server. If you generate web pages
using things like JSP then it will run on the server. If you develop things
like web page applets, then they will run on the client.

l8r, Mike N. Christoff

Jul 17 '05 #2

P: n/a
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

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.