views:

86

answers:

7

When constructing a website, say a Q&A site or a just a forum site for a community, is just knowing HTML,CSS,PHP, MySQL, and javascript enough to make the site dynamic?

I am saying this because when I talked with my teacher, he said that major sites use many languages combined. And he said that a site shouldn't be designed only in PHP.

So is it possible to create a good website, not e-commerce, with only html,css, and php?

+3  A: 

yes. there is no reason you should use more than one language internally. it makes making it all work together much easier in a server environment, where the extra load of IPC over function calls can slow things down considerably.

sreservoir
+2  A: 

Ofc! :)

Lots of large/enterprise portals use only HTML, CSS, Javascript, PHP & MySQL.

But don't forget that there's always a right tool for the right job... A simple site (even an e-commerce) will run very well on PHP & MySQL.

TiuTalk
that's good to hear. my teacher is obsessed with java and thinks every site should use it. I'm not familiar with java but can I do all the functions in php?
jpjp
what is ofc!...
Luke101
that always depends on what you want to do.
sreservoir
So every site done in PHP = bad, but every site done in Java = good? Sounds like a bad teacher.
Matt S
I had one of those teachers too - everything but Java is bad... hehehe
Ronaldo Junior
@Matt @Ron at least they weren't saying crazy things like PHP is actually a special subset of Java or that real websites are made in C with a CGI interface
Earlz
My teachers say the same thing... What I do? Wear my PHP lover t-shirt every day.. They hate me. ;)
TiuTalk
+1  A: 

Short answer: yes, it is possible.

Longer answer...

HTML, CSS, PHP and MySQL are already many languages, but I guess he means that most major sites have a heterogeneous back-end. This is probably not out of choice though -- more often it is historical. As people change and new technologies emerge, new pieces are built with different languages and frameworks.

I have built a forum and Q&A sites with HTML+CSS+PHP+MySQL and many other people have done the same, so this set of tools is without a doubt adequate for building something like this. In fact, I would argue that you could build almost anything on the web with that combination.

A more interesting question (that will generate more heated response) is what framework you use on top of that. A CMS like Wordpress of Drupal, or an MVC framework like Zend, CakePHP or CodeIgniter.

Or whether you should be dropping PHP entirely and using something like Django or Ruby on Rails. Knowing more than PHP will definitely help you to be ready for newer approaches.

Greg
is a PHP framework really necessary in building sites? Can I just manage my site with a basic MVC view and have functions?
jpjp
It isn't strictly necessary, but it will save you from rewriting a ton of code. And you will benefit from a high quality and security hardened foundation. BTW, what is a "basic MVC view"? Do you mean roll your own MVC framework?
Greg
+1  A: 

The dynamism of a website comes from a server side language that can create a HTML output on the fly, that's it. You can add a DB, simple JS or AJAX, but those are merely optionals.

Now, as for your teacher, languages like PHP, Python and ASP are, in the end, the same. It's ridiculous to have the includes files in ASP, the main files in PHP and the configuration files in Python, that makes absolutely no sense. Maybe, hopefully, he was talking about using JS in conjunction with PHP and SQL which is a natural recommendation.

Ben
A: 

The fact that your teacher is obsessed with another technology doesn't mean that you can't work with PHP only.

As the others said, it is perfectly reasonable and possible.

(I'm personally obsessed with ASP.NET, but still, I won't say that it is the only way to go for everyone. And PHP is just geat for beginners.)

Venemo
A: 

Is he referring to the front-end or back-end?

The front-end of a website - the part that the user sees and interacts with - must be written in HTML.

(It may optionally include CSS and Javascript to enhance it.)

The back-end is what generates the front-end, and also determines the structure and control-flow of the application.

There's absolutely no need to use more than one language for the back-end, and it's often simpler to stick to one language.

However, for the front-end, you have no choice but to use HTML; otherwise it isn't a web application.

jonathanconway
A: 

The front end must output HTML. These days it should use CSS for formatting. It will likely use Javascript to provide client side capability. Requiring javascript will likely create accessability issues for some users.

PHP is one of several languages used to handle requests. It is in interpreted language requiring the source be placed on the server. This opens up significant security risk if the someone gets access to the server. Several hosting sites have had major problems with PHP based sites over the last few weeks.

Java is run in a compiled form and code is not required to be on the server. This provides a layer of security as it is not simple to modify the code. Java runs in a container, and usually a framework. Developing using the Spring framework in a Tomcat container is an option. The learning curve is higher than with PHP. It also has strong support for accessing remote resources which allows it to integrate with legacy applications.

With any of the languages, there is a risk that developers will use available functionality when they shouldn't. The Java J2EE model is appropropriate for some sites, but was often implemented because it was the fashion, and there are a lot of tutorials on using it.

BillThor