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.
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.
greg posted this at 13:05—13th May 2008.
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.
www.worldwide-web.co.uk
www.hotnews-4u.com
bbmm1980 posted this at 15:47—13th May 2008.
They have: 8 posts
Joined: May 2008
I think you can learn java and php together.but java is not javascript.
Make Movie star on your bag - My gift boxes - Paper bag for jewelry
capricorn posted this at 02:18—26th May 2008.
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
web site builder
decibel.places posted this at 11:33—17th June 2008.
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.
~are you netsperienced?
[spacer recaps]
Meet me at The IT Contracting Network Coder's Corner
[recaps spacer]
View my profile on LinkedIn