PHP or JavaScript? What difference can one bring to the website ...?

Heni Y

New member
Hi,
I recently took a tut on Javascript and found that, when taking the tut for PHP that it has same topics (I don't know if this is the right word)like Javascript If...Else, JS while loops etc all of which are in PHP, like PHP if...else, PHP while loops. So I want to know what exactly a PHP can do to a webpage and what JS can do to a webpage. Can they be used interchangeably? THANK YOU SO MUCH!
 
they can be used interchangeably, java is client side, and php is server side. java will be a little more flashy, and php is more like html on steroid.

this probably isnt the best answer so i hope someone else chimes in but i hope this helps :)
 
Hi, Heni,

There are a lot of similarities between PHP's syntax and JavaScript's, because both use C-like syntax.

JavaScript and PHP function very differently.

PHP is a server based language. You need the server to support PHP to run.

JavaScript is a browser based language. You need the browser to support but need not the server.

In general, PHP is useful to generate dynamic content for the site. PHP can easily access to database, read files from the server, provide user log-in capability etc.

JavaScript is useful to provide addition GUI features to enhance the browsing experience. Example is change the image when the user place the cruiser over that image.

Nowadays, you can easily find web pages having both Php and Javascript for the functions.
 
Back
Top