Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Jonquil Russell - Can we use java script in php

Jan 28, 2014 3:04PM PST

Hello everyone, My name is Jonquil Russell. I am a student and learning php for web designing. I want to know how to use java script in php. Can someone help me and provide me a mode where I can learn this coding.
Thanks
Jonquil Russell

Discussion is locked

- Collapse -
Answer from my web buddy.
Jan 28, 2014 3:11PM PST

PHP is the back end and you can serve up java script to the browser (front end) to execute in the browser. On the back end I rarely see java script but do see Java.

Why Java Script on the backend when we have Java?
Bob

- Collapse -
Bob is correct
Jan 28, 2014 11:51PM PST

In a very traditional setup, you have a database (e.g. MySQL) to store your data, a server-side language (e.g. PHP) to retrieve that data, a markup language (e.g. HTML) that a browser can render, and then a client-side language (e.g. JavaScript) to interact with the rendered HTML in the user's browser.

That said, with newer technologies like Node.js, you can use also use JavaScript has a server-side language, but in that case it would really replace the need for PHP.

~Sovereign