JerryStephen wrote:I know PHP is generally a server side language and Javascript is generally a client side one
Both true (replace "generally" with "explicitly" if you're talking about websites specifically).
JerryStephen wrote:and HTML is in a world of its own
Not really; it's a client-side language just like Javascript is.
JerryStephen wrote:Specifically: my HTML code does NOT seem to recognize a PHP function in an "onclick" method/event, but it WILL call a Javascript one
That makes sense though, doesn't it? PHP code is evaluated and executed by the server and its output is sent to the client. At that point, the connection is severed and the transaction is complete.
JerryStephen wrote:it WILL call a Javascript one
Again, that should make sense... Javascript is evaluated and executed by your browser (hence the "client" side language).
JerryStephen wrote: Javascript does not seem to be able to run the PHP function either
Well, to be truthful, you already stated that - "onclick" events are handled by the Javascript engine. Again, for the same reasons above, it should make sense that a Javascript function can't execute PHP code.
JerryStephen wrote:Can I call PHP from within HTML or Java?
Whoa, wait a minute... now you're introducing a third language into the mix. Did you perhaps mean Javascript and not Java (huge difference)? :p
The answer is... no, not directly. You can use AJAX to make requests make to a PHP script that can then output a response that your Javascript functions can interpret and do something with.
JerryStephen wrote:Can I share variables from one to another?
Yes, but depending upon which direction you're talking about (e.g. from PHP to Javascript, or from Javascript to PHP -- in other words, from the server to the client, or from the client back to the server) there are different ways of doing it. For example, to share a PHP variable with Javascript code that will be executed by the client's browser, you can use PHP to generate Javascript code, e.g.:
echo '<script type="text/javascript">myJavascriptVar = "' . $phpVariable . '"; </script>';