English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

That won't work. PHP is processed on the server's side; JavaScript is processed on the client side. Thus, any PHP code you enter in a JavaScript document.write() method will simply be ignored by the server, because the server will never see it.

What you really need to do is use AJAX to send a request to a PHP page, and have a PHP page echo back to you a response you can handle with JavaScript.

2006-12-03 07:17:40 · answer #1 · answered by Anonymous · 1 0

this isn't any longer Hypertext Preprocessor, it particularly is HTML and JavaScript. once you're writing a talk software in Java, you particularly do no longer p.c. that code in any respect. What you will p.c. is: a million) a archives of Java... do no longer make a talk software till you realize Java and merchandise-orientated innovations all right. 2) awareness of Java GUI (Swing). 3) awareness of Java networking applications. you may Google "the thank you to make a Java chat customer" and you will desire to get some effects. besides the fact that, in case you won't have the ability to tell apart between HTML, Hypertext Preprocessor, JavaScript, and Java, i might propose which you do no longer embark on a talk software.

2016-10-13 22:27:56 · answer #2 · answered by ? 4 · 0 0

You can do it, but it's not going to work. PHP runs on server, JavaScript runs on client (i.e., in the Web browser). By the time JavaScript can start running, PHP is done working.

2006-12-03 12:58:53 · answer #3 · answered by NC 7 · 1 0

in ure php file u just do....

.....blabla.....
document.write('');
......more blabla.....

Now the php will do the thing it does b4 its sent to the user. If this is ok then there u go :-)

2006-12-03 07:12:42 · answer #4 · answered by Anonymous · 0 1

i don't think you can, you can do the opposite (adding a javascript code in php code using: echo "code";), u can try it with jave: print "code"; but i never tried it..

2006-12-03 06:37:07 · answer #5 · answered by Anonymous · 1 0

fedest.com, questions and answers