Hi, I’m working on a little AJAX app using a PHP script but am having two problems with it:


(1) My XHTML file won’t validate because of this part:

Code:
XMLHttp.send(
	"action=view"
	+(form.title.value  == "" ? "" : "&title=" +form.title.value)
	+(form.artist.value == "" ? "" : "&artist="+form.artist.value)
	+(form.album.value  == "" ? "" : "&album=" +form.album.value)
	+(form.year.value   == "" ? "" : "&year="  +form.year.value)
);
The validators complain about the ampersands; they say that the entities &title, &artists, &album, and &year are not valid. I tried replacing them with &title, etc. and that does fix the validation, but they no longer register as a parameters in the PHP script.

Any ideas?


(2) The PHP script returns some text that is inserted into a DIV on the page from XMLHttp.responseText, but it gets messed up if the returned text has UNICODE characters in it.

Any ideas?


Thanks a lot.