Ezilon.com - Target Your Audience, be Seen in Your Region

jarva or php

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 17 posts

Joined: May 2007

i am am just starting out and would like to know what is the best scripted to learn out of jarva or php

DeveloperModerator

He has: 478 posts

Joined: Nov 2005

I presume by "jarva" you mean Javascript"? Java is a little different to Javascript.

It depends on what you want to do really.

PHP is excecuted on the server, and Javascript in the browser.
JS (Javascript) can do a few things PHP cannot, but PHP can do more things that JS cannot.

PHP cant instigate a pop up for example, even without the annoying ad pop ups, a confirmation or message pop up is sometimes useful. The alternative with PHP is to load another page with more PHP code and do some calculations and output the result on the page, I.E. "Incorrect login" or whatever.
Of course you can put JS in a PHP file as and when you need it, so the two can be mixed.
JS can't (by itself) connect to a database to get or write info.

JS can be turned off in the browser settings, although it doesn't stop all JS, but if a user has done this some of your scripts won't work for that user. Most coders work around this by providing an alternative to the JS code. You can also easily check if a user has JS enabled in the browser settings, and if YES provide JS ELSE alternative to JS if NO.

JS is very powerful and when you understand the code it can perform fantastic things on your site.
But PHP is also very powerful.

I have never really learned JS because PHP does everything I need (mixed with HTML and CSS).
There are times when I could implement something that JS would be better for, or in fact where only JS will do the task, but it is very rare in my case and I simply work around it with PHP or sometimes CSS.

I think it would be fair to say that people who use JS will also need PHP from time to time, so learning JS you will need to also learn somePHP.
Whereas with PHP you can 'make do' with alternatives to the unique JS abilities.

Most sites these days take advantage of a database, even if it is just storing prices for products. The prices can be obtained from the DB and displayed throughout the site and it's then easy to change those prices in the DB, and they will be changed throughout your site automatically and instantly.
If you ever want to use a database, for example registration and login, you will need PHP (or another language that communicates with a database, not JS).

So, as I said, it depends on what you want to do on websites.
Personally, I would advise learning PHP, then later learn JS or just learn the bits of JS that PHP doesn't have.

They have: 8 posts

Joined: May 2008

I think you can learn java and php together.but java is not javascript.

They have: 10 posts

Joined: May 2008

Thats well defined by developer...

I think php is best for web design these days. More safe and easy to use.

Thanks

decibel.places's picture

They have: 207 posts

Joined: Jun 2008

I agree with developer that it is useful to know both javascript and php

Java can be a very powerful programming language, but on web sites it is generally used for special widgets - "applets" - that are embedded for a specific purpose - or for a standalone internet application that is not really a web site.

I learned javascript first and came to learn php because it was necessary to manage cms sites, such as sites using Drupal (like The Webmaster Forums site).

Along with javascript, it is helpful to have a good understanding of css for dhtml (dynamic html).

I think along with php it is very useful to learn sql for database management.

I often pass variable values between php and javascript and can create some very dynamic pages that way. A php page using javascript for form validation (are the fields filled in? is the email well-formed containing "@" before "."?) and sql to save the name/email pairs in a database and check if an email has already been saved. (Warning - this is a live site and if you enter your email you will be contacted)

This page uses php and sql for search, and javascript and css for the various views depending on the user's actions, but all the different views are actually contained in one page. The "page" itself is made up of about 3 or 4 php files put together (using php you often "include" other php files).

w3schools is a great resource for tutorials and reference; also, Jennifer Kyrnin's excellent About.com site will take you step-by-step learning html, css, how to use javascript and more.