[Phpwm] PHP or JavaScript

Richard Cunningham richard at richardcunningham.co.uk
Tue Feb 23 15:35:19 UTC 2010


Not forgetting you need to validation on the server side too for
security, if nothing else, even if you have Javascript validation.

Lester Caine wrote:
> Mo Awkati wrote:
>   
>> Hi All
>>
>> /* This is not intended to fuel a heated debate about which is better! */
>>
>> I just need to be clear in my mind as to which is appropriate to use and
>> when. I recognise that one is server side and the other is browser side.
>> I see both as tools in a toolbox and therefore use as appropriate.
>>
>> The way I see them: JavaScript for presenting web pages, PHP for data
>> handling and processing.
>>
>> Am I on the right tracks? I would welcome your thoughts on this, if you
>> can give me an example/s where one is more appropriate to employ than
>> the other, or indeed where they both live happily together! Obviously
>> there are areas where they overlap.
>>     
>
> If you want to do something in the browser, like display a calendar drop down, 
> or check data before passing it back to the server - you need Javascript.
>
> Everything else is done in the server using PHP ..... But PHP creates html 
> content which is what is sent to the browser, including any javascript and css 
> information needed for the browser to display the page.
>
>   



More information about the Phpwm mailing list