It mostly depends on what the situation / functionality desired involves.
It's just a question of understanding when and how to use each one :)
Roughly akin to the difference between English and German. They can express largely the same things, but do so in different ways, and you'll have more luck using English in Germany then German in England.
i know one is server side scripting and the other is browser side
PHP is a programming language. It is often used for server side programming, but has uses in general programming too.
There are plenty of other languages that can be used for server side web programming too (C# is popular in ASP.NET, I'm rather fond of Perl, there are quite a lot of proponents of Python and Ruby, Java has a strong following, and so on).
That said. El Cheapo hosting which supports PHP is a lot more common than El Cheap hosting which supports other things. Leaving language partisanship aside, the primary disadvantage with it is that El Cheapo hosting is has the You Gets What You Pay For rule.
If we take your question to be about the difference between server side and client side programming though…
but what m asking is that using client side programming i can display alert messages
With client side programming you can manipulate things in the browser without going back to the server. e.g. you can add elements to the document to display a message.
You also have access to APIs provided by the browser, such as the
alert() method which will display a message box that isn't an intrinsic part of the document and Local Storage (which lets you store data in the browser which only that browser will have access to).
You can make HTTP requests to ask the server for things (this is called Ajax).
which i can simply do with server side programming also,without using any function
With server side programming, you can modify the document you are sending to the client, but only at load time.
You can access shared resources (such as the contents of a database that lives on the server).
You don't have access to things like the
alert() method. (Although you can generate program code (usually in JS) that will run client side and will have access to those methods).
so does server side and client side programming are exclusive ,like if i use one then the other one should not be used,or ??
Client side programming, on the other hand, can be used to make things more convenient for the user. You can add animation to indicate that something is happening, check data before it is submitted to the server (saving the time of a round trip), update part of a page periodically, and so on.
©2020 All rights reserved.