wood burning stoves 2.0*
The moose likes PHP and the fly likes This weeks Giveaway Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "This weeks Giveaway" Watch "This weeks Giveaway" New topic
Author

This weeks Giveaway

Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
This week we are giving away 4 copies of the book "'Professional PHP4 Web Development Solutions"
The good part, the Author, Bryan Waters will be on-line to answer your questions!
Thanks to the good people at [http://www.wrox.com]Wrox[/url] for the books.
Budong Li
Greenhorn

Joined: Nov 20, 2002
Posts: 9
Can anybody compare PHP and JSP?
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
How about PHP vs Perl


Normal is in the eye of the beholder
aaron ho
Greenhorn

Joined: Jan 07, 2003
Posts: 7
PHP and JSP are not entirely differently, but they exist for a different purpose. JSP is the presentation layer (to the user) of a java servlet. A JSP page is usually created from a servlet or returns information to a servlet for processing. JSP pages do not do any 'processing' work.
PHP has no formal separation of the presentation layer from processing. A PHP page can (and does) the processing, logic, etc. needed.
In other ways PHP and JSP are the same. The semantics of both are close to C. They are both able to be run on any platform that supports its runtime environment (jre, php.exe).
There are tons of arguments which is better to use, faster, etc. which I will not go into because I do not code enough in java. I have used PHP much more and it is very easy to learn with no training (just need internet access).
Stephen Clark
Greenhorn

Joined: Jan 07, 2003
Posts: 1
I agree with Aaron, PHP is very easy to learn, and very fun to use.
If you have at least basic understanding of programming, you will pick up PHP.
PHP, mySQL, and Apache are a common trio being used together and all available online for free. Gettig mySQL and Apache up and runing can be a little tricky at first, but you can quickly start writing PHP code to run on your Apache server.
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,
Originally posted by aaron ho:
A PHP page can (and does) the processing, logic, etc. needed.

Can i use PHP on presentation layer?

They are both able to be run on any platform that supports its runtime environment (jre, php.exe).

As far as JSP is concern i agress it can run on any platform, but how PHP?.Dose it uses Java?.
However its a good featurs that it is easy to learn and get hands on practice.
Bye,
Viki.


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
aaron ho
Greenhorn

Joined: Jan 07, 2003
Posts: 7
Can i use PHP on presentation layer?
********************************
Yes, you must use it. PHP does not formally enforce the Model-View-Controller concept the way Java does. In Java, JSP=presentation, servlet=control; in PHP the php script is the presentation and control.
As far as JSP is concern i agress it can run on any platform, but how PHP?.Dose it uses Java?.
**********************************
PHP can run on any platform where the php processor can be loaded. Currently both major webservers (apache & IIS) both support it. A whole slew of other webservers also support, but I have no experience with them.
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,
Originally posted by aaron ho:
Can i use PHP on presentation layer?
********************************
Yes, you must use it. PHP does not formally enforce the Model-View-Controller concept the way Java does. In Java, JSP=presentation, servlet=control; in PHP the php script is the presentation and control.

U mean in PHP Domain Layer and Presentation Layer cannot be de-coupled?.If so then does it is the good feature of PHP?.
Bye,
Viki.
aaron ho
Greenhorn

Joined: Jan 07, 2003
Posts: 7
U mean in PHP Domain Layer and Presentation Layer cannot be de-coupled?.If so then does it is the good feature of PHP?.
********************************
There is no formal separation. Just as you can use a servlet for the presentation layer in java, PHP scripts are used for both presentation and logic. It is up to the programmer to 'de-couple' the layers.
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,
Originally posted by aaron ho:
There is no formal separation. Just as you can use a servlet for the presentation layer in java, PHP scripts are used for both presentation and logic. It is up to the programmer to 'de-couple' the layers.

Ok! I got it now.Thanks for explaining.
Bye,
Viki.
Rick Portugal
Ranch Hand

Joined: Dec 17, 2002
Posts: 243
PHP is great. I took a lot of it in the 60's.


IBM 286, SCJP, SCWCD, EIEIO
Ravee Bhat
Ranch Hand

Joined: Nov 26, 1999
Posts: 72

Originally posted by Leslie Chaim:
How about PHP vs Perl

I believe, compared to the powerful text processing and other scripting (e.g. apxs) , php is more appropriate on the web applications.
Could someone throw more light on this part?
thanks and regards
Ravee.
aaron ho
Greenhorn

Joined: Jan 07, 2003
Posts: 7
I believe, compared to the powerful text processing and other scripting (e.g. apxs) , php is more appropriate on the web applications.
******************************************
Yes, php is made for web apps. There is also a movement toward true O-O language with the release of php version 5. Also there is a vb like extension called GTK. Basically the founders take what they like from other languages and implement them. Here is a good 'info' link:
http://zend.com/zend/aboutphp.php
aaron
shalini sharma
Greenhorn

Joined: Nov 21, 2002
Posts: 26
The difference between JSP and PHP is I think is that JSP is Java Server Page Technology and PHP is an open source web scripting Language.Both of them allow scripting code in regular webpage to generate dynamic content.
Previously PHP pages were interpreted by server when it's requested but from PHP 4 pages are compiled to improve the performance.
Please correct me if am wrong

Jyothi
[ January 09, 2003: Message edited by: Jyothi kidambhi ]
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,
Originally posted by Jyothi kidambhi:
The difference between JSP and PHP is I think is that JSP is Java Server Page Technology and PHP is an open source web scripting Language.Both of them allow scripting code in regular webpage to generate dynamic content.
Previously PHP pages were interpreted by server when it's requested but from PHP 4 pages are compiled to improve the performance.

Remember there is a difference n/w three terms,
Interpreted,Compiled and Parsed.
I think scripts are parsed reather than interpreted.
Bye,
Viki.
 
 
subject: This weeks Giveaway
 
Similar Threads
Free Servlet Engines Out There?
doGet() and doPost()
Difficulty of SCJP exam Vs. JQPlus mock tests and K & B mock exams from SCJP Study Guide
threads with http sockets
Which Java jobs website is the best?