0

i am a newbie in learning php, and i would like to know if php can be used just as javascript being initialized in the head of an html docment to be called whenever you need it?

5
Contributors
5
Replies
9
Views
10 Years
Discussion Span
Last Post by WhiteLeo
0

I don't think you can do that at all with PHP because it need to be processed by the PHP engine (server side).

0

so, when i write php, it must be written down in the body, so when loaded it is able to communicate with the server?

so php functions cannot be called when you need them?

0

PHP is executed on the server, not in the browser. So it doesn't matter where you put it. If you want something executed in the browser you must use JavaScript.

0

You can look up AJAX, which is php functions executed on the fly by javascript.

That's probably what would work for you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.