@shakeukJun 23.2008 — #because php is server side script and it will run b4 any information is even rceived by your browser, so javascript wont be able to run it like you have suggested.
ajax is a combination of javascript and a server side script (i.e. php) so have a look at this page it may help.
@Joseph_WitchardauthorJun 23.2008 — #So with the code I wrote above, would it do what I wanted it to do if I just simply wrote it in AJAX instead of plain JavaScript?
@shakeukJun 23.2008 — #yes and you could pull the result of the server side process could be displayed without having to reload the page at all. not like you would have to with php.
@Declan1991Jun 23.2008 — #So with the code I wrote above, would it do what I wanted it to do if I just simply wrote it in AJAX instead of plain JavaScript?[/QUOTE] The thing is that it is just plain JavaScript. Remember that what the browser gets has no PHP. So view the source if you ever want to check something.