php & Javascript are very popular scripting languages.There may be more

.
There is a big difference. php executes on server side (Web Server) while JavaScript executes on client side (ex: browser).
So JavaScript is not used for stuff like database access and php is not used for browser based operations such as detecting button presses, hover, etc...
Java,C++ etc are programming laguages.can you please tell me what is the deference of these two.??
Yes. Java and C++ are programming languages. But there are lots of differences.
Java is not only an application programming language such as C++ (generally). Java is used on server side scripting (JSP, Servlets), on mobile platforms such as J2ME, Android, etc...
Java is a platform independent programming language. That means once you compile it, you will be able to run it in many platforms with a JVM. C++ executables needs to be recompiled using cross-compilers to run on different platforms.
Java is completely an object oriented programming language. C++ can be either used as Object oriented or procedural language.
C++ has pointers (direct memory access) where as Java doesn't support memory pointers.
C++ has lots of control on the OS and underlying hardware where as Java doesn't provide such deep access to the users. This is the reason for using C/C++ for system programming and embedded development. Even Java is developed using C/C++.
C++ very fast since it compiled to direct machine instructions on the underlying hardware. Java is too slow to run in most of the cases due to interpreting byetecode on JVM.
Have a look at this wiki article for a complete comparison.
Comparison of Java and C++
Microsoft has made C# as a competitor for Java and you might be interested to compare C# with Java as well.
See
Comparison of C Sharp and Java